- Abhishek Bapat
- build-essential, clang, lld, mkisofs, virtualbox. (install with sudo apt install)
- navigate to the project folder and clone the repo fwimage written by Dr. Ruslan Nikolaev by running
git clone https://github.com/rusnikola/fwimage
- xen for assignment 3.
- Basic UEFI bootloader which finds a 800x600 32-bit BGRA graphics mode and sets it. It passes the framebuffer to the kernel. The bootloader then calls
ExitBootServices()
before loading the kernel. - Kernel sets up a 1:1 page table for the kernel space. The kernel then writes data to the framebuffer to print a shape on the screen.
- Navigate to Assignment_1 and run
sudo ./make.sh
. - Create a VM on virtualbox with UEFI enabled and boot with boot.iso.
- Bootloader allocates 4kb page aligned buffers for kernel, user application, kernel stack, user stack, kernel page table and user page table.
- Pointers to these buffers are then passed to the kernel.
- The kernel initializes the kernel page table and the user page table.
- The kernel then jumps to the user app and the user app makes 2 system calls to print values on the frame buffer.
- Two entries in the end are reserved for TSS.
- One page is allocated in the bootloader for TSS Segment, and one more page is allocated for TSS stack.
- The method tss_segment_init() in kernel.c initializes the TSS_Segment with the appropriate values. GDT offset is calculated as 0x28. It then calls load_tss_segment with the offset and tss_segment pointer.
- The tss_stack pointer is allocated in the tss_segment rsp[0].
- All the other values in tss_segment are initialized to 0 using the __builtin_memset() function.
- IDT has a default handler to handle all the 256 exceptions.
- A separate handler is written for pagefaults. In the user app a page fault is generated by accessing memory which is not mapped. The page fault handler then maps a page to the memory location accessed.
- The kernel is extended to implement the APIC timer and Thread Local Storage.
- Navigate to Assignment_2 and run
sudo ./make.sh
. - Create a VM on virtualbox with UEFI enabled and boot with boot.iso.
- Assignment 3 extends the kernel to work with xen.
- The kernel detects xen hypervisor, initializes hypercalls and prints the xen version on the screen.
- Then it implements a busy wait loop using the monotonic and the wall clocks.
- There are two separate guests written, one initializes shared memory and writes data to it. The other guest reads data from the shared memory.
- Navigate to Assignment_3 and run
sudo ./make.sh
. - Run the command
sudo xl create code-hvm.cfg
to create a xen guest domain. - Edit the code-hvm.cfg file with the boot.img path.