Friday, April 28, 2006

Kernel @ 1 MB

Till now, secondary loader loads the kernel at 0x9000. Now, the loader will load the kernel at 1MB mark. Also, I have created a linker.ld file to link the kernel at 0x100000. Below is my linker.ld script:

ENTRY (_start32)

.text 0x100000 :
{ *(.text) }

.data :
{ *(.data) }

.bss :
{ *(.bss) }
  • I have implemented PMM (Physical Memory Manager) in my kernel, which runs below VMM (Virtual Memory Mapper). Though, it is in its priliminary stage.
  • init_pmm() - Will initialize the stack, which holds the address of free pages. The stack is initialized based on the memory map passed by the LEXOS' secondary bootloader. PMM will ignore any usable memory below 1 MB, as it is reserved for V86 mode.
  • alloc_page() - Will pop a free page from the stack and return it to the calling thread. The PMM returns the physical address of the free page. This address will be mapped by the VMM to the process' virtual address space.
  • free_page() - Will push the page to be freed into the stack.