📄 mytest.c
字号:
/** @file 410test.c * @brief A test file for your drivers. *//* -- Includes -- *//* libc includes. */#include <stdio.h> /* for lprintf_kern() *//* multiboot header file */#include <multiboot.h> /* for boot_info *//* memory includes. */#include <lmm.public.h> /* for lmm_remove_free() *//* x86 specific includes */#include <x86/seg.h> /* for install_user_segs() */#include <x86/pic.h> /* for pic_init() */#include <x86/base_irq.h> /* for base_irq_master/slave */#include <interrupts.h>#include <kerndebug.h>#include <timer_defines.h>#include <console.h>/* Driver includes */#include <kernel_init.h>/* * state for kernel memory allocation. */extern lmm_t malloc_lmm;/* * Info about system gathered by the boot loader */extern struct multiboot_info boot_info;/* --- Kernel entrypoint --- */intmain(){ /* * Tell the kernel memory allocator which memory it can't use. * It already knows not to touch kernel image. */ lmm_remove_free( &malloc_lmm, (void*)USER_MEM_START, USER_MEM_SIZE ); lmm_remove_free( &malloc_lmm, (void*)0, 0x100000 ); kernel_init(); /* * initialize the PIC so that IRQs and * exception handlers don't overlap in the IDT. */ pic_init( BASE_IRQ_MASTER_BASE, BASE_IRQ_SLAVE_BASE ); /* Disable timer interrupts */ pic_disable_irq(0); /* Implemented you testcases here */ /* ... */ while(1) { } return 0;}/* The following 4 functions should never be implemented here!!! */void *GameProcess1(void *argv){ return NULL;}void *GameProcess2(void *argv){ return NULL;}void *GameProcess3(void *argv){ return NULL;}void *GameProcess4(void *argv){ return NULL;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -