55 asm(
".text\n.align 4\n" 62 asm(
".text\n.align 4\n" 64 " movl 4(%esp), %eax\n" 112 return (t != NULL) ? p : NULL;
144 assert(module[0].mod_start && module[0].mod_start < module[0].mod_end);
145 assert(module[1].mod_start && module[1].mod_start < module[1].mod_end);
163 fileSystemInit((
void*)module[1].mod_start, module[1].mod_end - module[1].mod_start);
166 initProcess =
loadELFModule((
void*)module[0].mod_start, module[0].mod_end - module[0].mod_start);
178 consoleWriteString(
"\n\nThe last process was terminated. You can now safely reboot your computer.\n");
bool handleSet(struct handleTable *table, uint32_t handle, struct object *object)
Associates a handle (index) with a kernel object.
struct thread * threadCreate(struct process *p, struct thread *original, void *eip)
Creates a new kernel thread object.
struct process * processCreate(struct process *original)
Creates a new kernel process object.
void pagingInit()
Initializes paging.
void consoleSetFont()
Load a custom font supporting latin1 characters.
void physMemProtectBootEntry(uint32_t addr, uint32_t length)
Marks all pages within a memory range as reserved and adds them to the boot map.
void threadSchedule()
Schedules threads until all process have been terminated.
void fpuInit()
Initializes the FPU related bits in the CR0 register.
void consoleInit()
Initializes the console.
#define MULTIBOOT_INFO_MODS
struct pipe * pipeCreate()
Creates a new kernel pipe object.
void physMemInit(multiboot_info_t *bootInfo)
Initializes the physical memory management.
uint32_t __setCR0(uint32_t value)
bool elfLoadBinary(struct process *p, void *addr, uint32_t length)
Loads an ELF executable stored in the memory into a process.
void fileSystemInit(void *addr, uint32_t length)
Initializes the root file system.
void keyboardInit(struct object *obj)
Initializes the keyboard.
multiboot_uint32_t mods_count
void consoleClear()
Clear the screen contents.
void picInit(uint32_t interruptOffset)
Initializes the programmable interrupt controller.
void consoleWriteString(const char *str)
Write a C string to the console.
struct handleTable handles
struct process * loadELFModule(void *addr, uint32_t length)
Spawns a new process, and afterwards loads the ELF module into it.
void timerInit()
Initializes the system timer.
multiboot_uint32_t mods_addr
void gdtInit()
Initializes the GDT, task registers, and sets up everything required for multiprocessing.
void kernel_main(multiboot_info_t *bootInfo)
Kernel main entry point.
struct stdout * stdoutCreate()
Creates a new kernel stdout object.