Skip to content

pmtest.bin and kernel.sys

Levin Palm edited this page Nov 29, 2024 · 1 revision

There is a folder called c-tests in the root directory of the floppy image. It contains, among others, the two files pmtest.bin and kernel.sys.

These are a new and experimental 32-bit protected mode kernel. pmtest.bin is the 16-bit loader program that loads kernel.sys at the physical location 0x1000:0x0000, switches the CPU into 32-bit protected mode and starts executing kernel.sys.

The code for this is in the csoftware/kernelC/kernel directory if the repository.

kernel.sys currently does the following:

  • set up GDT for ring0, ring3 and a TSS
  • set up identity paging for the first 4MB of the RAM
  • remap the PIC to interrupts 0x20-0x27 and 0x70-0x77
  • sets up the 32 exception interrupts
  • sets up a systemcall interrupt on vector 0x80
  • enables ISA DMA Channel 2 for the floppy drive

Formated printing is available via printk(cons char* format, ...) and keyboard input is available via the void getch(void) function.

Floppies can be read sectorwise. A FAT12 driver is in work. The root directory can be read already (without the BIOS interrupt 0x13 ofc)

Clone this wiki locally