CSE 30341 Spring 2025 at Notre Dame
(This is not required information, but may be of interest if you want to explore operating system kernels more deeply.)
Basekernel is a small operating system kernel by Prof. Thain for demonstrating the principles of operating systems. You can build and try it out yourself in a virtual machine on your laptop, if you like. Most every principle that we work with in this class can be found in the code of Basekernel:
0xfffffff0) at the top of memory. At this location, a ROM provides a pointer to the boot-up code contained in the ROM BIOS (Basic Input/Output System). This boot-up code performs some simple initialization, power-on-self-test (POST), and then starts to load the operating system from disk. It does so by loading just the first sector (or bootblock) from the disk into location BOOTBLOCK_START (0x7c00) and then executing the first instruction there.KERNEL_START (0x10000). Once all sectors are loaded, it jumps there.kernel_main.install, format, or mount to set up the system, and then finally run to start the first process in user mode.kernelcore.S. Each entry in the table jumps to an assembly language routine like intr00 that may push a value on to the stack, to get a consistent layout. These routines jump to intr_handler which saves registers, sets up a C-compatible stack, and jumps to the C-language function interrupt_handlerinterrupt_handler_table corresponding to the desired interrupt. Various parts of the kernel code can use interrupt_register to arrange for a C-language function to be called for specific interrupts. These handlers are universially known as something_interrupt to make it clear that they are limited.interrupt_register to set up keyboard_interrupt as the function to read the next item from the kyeboard.syscall.syscall which puts arguments into registers, and then forces a trap with the int 0x80 instruction.intr00-intr48 that
eventually call C functions interrupt_handler and syscall_handler.syscall_handler which examins the provided arguments, and then calls functions like sys_process_fork and sys_open_file as appropriate to carry out the request.struct process is the equivalent of the Process Control Block (PCB).current pointer to the currently-running process, as well as the ready_list of processes, and the grave_list of completed processes.list_pop_read(&ready_list). When preemption is disabled, the policy is effectively FCFS. When preemption is enabled, it is effectively Round Robin.Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!