- 3m
- 9m
- 12m
- 4. Downloading and building a 64 bit cross compiler 14m
Developing a Multithreaded Kernel From Scratch: Part Two - Module One
About this course
This course is the continuation of Part 1, where we built PeachOS, a fully functioning 32-bit multitasking operating system. In Part 2, we take the project to the next level: building a 64-bit multi-threaded kernel that runs in long mode with a graphical user interface (GUI) capable of rendering interactive, clickable, and draggable windows. Need the part one course click here
This isn’t just theory—you’ll be building a complete, modern OS step by step, starting from the bootloader all the way up to a graphical desktop environment.
Part 2 - Module 1 Overview
In the first module of Part 2, we focus on the foundations of a modern 64-bit kernel. We migrate from 32-bit protected mode into 64-bit long mode, create a UEFI bootloader, and lay down the critical systems that will later allow us to support GUIs, multitasking, and advanced storage.
Here’s what we cover in detail:
🔹 Graphics & Display
— Capture and take control of the UEFI framebuffer, giving us the ability to write pixels directly to the screen.
— Implement full support for loading images and fonts.
— Build a terminal system that uses pixel-based fonts to render text directly onto the display.
— Design a graphical subsystem on which the terminal itself is built. This includes:
— Relative drawing anywhere on the screen.
— Hierarchical graphics (parents and children, with relative offsets).
— A system that allows complex UI elements to be composed cleanly and drawn efficiently.
🔹 Memory Management
— Rebuild the heap allocator so that it dynamically uses the E820 memory map provided by UEFI/BIOS, instead of relying on a fixed memory region.
— Develop a multi-heap system, capable of merging multiple heaps into a unified allocator that intelligently chooses blocks for allocation.
— Implement a paging-based memory defragmenter that can remap scattered free regions into a single continuous block of memory—solving fragmentation issues and maximizing usable RAM.
🔹 Disk & Partitions
— Extend our FAT16 filesystem to support multiple GPT partitions.
— Mount each partition as a virtual drive, allowing the OS to work with multiple logical disks simultaneously.
— Redesign and abstract the disk system to support this multi-partition model, preparing the kernel for future support of modern storage hardware like SSDs.
✅ By the end of Module 1, you’ll have:
— A 64-bit kernel bootable on modern UEFI systems.
— A fully functional terminal with a graphical foundation underneath.
— An advanced heap allocator with defragmentation support.
— A multi-partition disk subsystem capable of treating different GPT partitions as separate drives.
— The core building blocks required for a GUI-based operating system.
Module 2 builds directly on this foundation and focuses on turning the kernel into a full graphical operating system with multitasking, drivers, and a rich user experience.
You will:
— Expose standard C library functions (fopen, fread, etc.) to userspace through isr80h.
— Build the complete windowing system, with support for fully interactive GUI elements.
— Implement an NVMe SSD driver, enabling high-speed reads from modern solid-state storage.
— Add full PCI/PCIe support, including bridges, making the kernel capable of scanning and interacting with a wide variety of devices.
— Access a GitHub repository of user programs that you can run directly on your OS. You’ll even be able to submit pull requests to share your own user-space programs with other students in the course.
By the end of Part 2, you’ll have created a multi-threaded, 64-bit, GUI operating system from scratch—bootable on modern hardware and extensible enough to run real user applications.
What you'll learn
- Build a 64-bit multitasking kernel from scratch
- Write a UEFI bootloader to boot on modern hardware
- Switch the CPU into long mode (x86-64) and run your kernel there
- Capture and use the UEFI framebuffer to draw pixels directly to the screen
- Load and render images and fonts in your OS
- Build a graphical terminal system capable of text rendering via pixels and fonts
- Design a hierarchical graphics system supporting relative drawing and child graphics
- Implement a dynamic multi-heap memory allocator using E820 memory regions
- Create a memory defragmenter using paging to provide continuous virtual memory blocks
- Extend the FAT16 filesystem to support multiple GPT partitions and virtual drives
- Abstract and rewrite the disk system to support multi-partition mounting
- Lay the groundwork for a full GUI windowing system with draggable, clickable elements
- Prepare to add userspace stdio functions, PCI, and NVMe drivers in later modules
Who this course is for
- Programmers who want to understand operating systems at a low level
- Developers interested in kernel and OS design from scratch
- Students of computer science, systems programming, or embedded systems
- Hobbyists who enjoy building their own OS or experimenting with bare-metal programming
- Engineers who want to learn modern 64-bit, UEFI-based booting and kernel development
- Anyone curious about memory management, paging, and heap design in kernels
- Developers who want hands-on experience with graphics, terminals, and GUI systems
- Programmers looking to implement file systems, disk drivers, and PCI/NVMe support
- Learners who enjoyed Part 1 (PeachOS) and want to continue into 64-bit multi-threaded kernels
- Advanced C programmers seeking a real-world project that pushes their skills
Requirements
- A computer (Windows, macOS, or Linux) capable of running QEMU/VirtualBox/VMware
- Basic knowledge of C programming (pointers, structs, functions)
- Familiarity with x86 assembly language at a beginner level (recommended)
- Understanding of basic computer architecture concepts (CPU, RAM, stack, registers)
- A code editor or IDE of your choice (VS Code, CLion, Vim, etc.)
- Willingness to use the terminal/command line for building and testing the OS
- GCC or Clang toolchain installed (I’ll show you how to set it up)
- (Optional but recommended) Completion of Part 1: Developing a Multitasking Kernel From Scratch a.k.a Kernel Development For Beginners Tutorial
Curriculum
103 Lessons • 21h 12m estimated learning time- 1. Cloning PeachOS and preparing our project 7m
- 2. How do you get to long mode 12m
- 3. Rewriting our bootloader to get to 64 bit long mode 34m
- 4. Getting from kernel.asm back to kernel.c in long mode 12m
- 1. Restoring simple terminal functionality 4m
- 2. Restoring heap functionality 8m
- 3. Changing pages from 2MB to 4KB 12m
- 4. Restoring and Improving Page Mapping Systems In Our C Code - Part One 20m
- 5. Restoring and Improving Page Mapping Systems In Our C Code - Part two 50m
- 6. Restructuring build files 5m
- 7. Abstracting out kernel paging functionality 4m
- 8. Allowing kernel heap to have a dynamic size 15m
- 9. E820 Memory Maps 7m
- 10. Building the E820 Memory Map functionality 23m
- 11. Multi-heap explained 12m
- 12. Building our multi-heap - Part 1 48m
- 13. Page Mapping Present only available E820 memory 7m
- 14. Building our multi-heap - Part 2 7m
- 15. Building our multi-heap - Part 3 17m
- 16. Building our multi-heap - Part 4 11m
- 17. Building our multi-heap - Part 5 15m
- 18. Creating callback handlers for our individual heaps 8m
- 19. Building our multi-heap - Part 6 19m
- 20. Building our multi-heap - Part 7 16m
- 21. Building our multi-heap - Part 8 13m
- 22. Building our multi-heap - Part 9 26m
- 23. Implementing the paging_get and missing paging functions 11m
- 24. Calling multiheap_ready 3m
- 25. Reimplementing the IO to work for 64 bit 9m
- 26. Loading more sectors of our kernel in boot.asm 1m
- 27. 64 Bit pushad and popad and making IDT 64 bit 4m
- 28. Remaking idt.asm to work with 64-bit code 5m
- 29. Remaking idt.c to work with 64-bit code 14m
- 30. Testing our upgraded 64 bit idt 8m
- 31. Adding user segment descriptors to the GDT 3m
- 32. Rebuilding the task system to be 64-bit 21m
- 33. Rebuilding the task system to be 64-bit - Part two 6m
- 34. Rebuilding the process system to be 64 bit 6m
- 35. Implementing paging_desc_free in paging.c 7m
- 36. Implementing kernel_desc and moving paging prototype function 2m
- 37. Testing our changes 6m
- 38. Bringing FAT16 into 64 bit mode 3m
- 39. Bringing the disk functionality into 64 bit mode 2m
- 40. Bringing process functionality into 64 bit mode 2m
- 41. Building GDT and TSS C Code 15m
- 42. Finalizing TSS code and Initializing it in the kernel 19m
- 43. Creating GDT Descriptors for TSS 3m
- 44. Restoring the disabled IDT functionality 5m
- 45. Restoring the keyboard 3m
- 46. Registering the isr80h commands 5m
- 47. Loading the TSS 3m
- 48. Refactoring the isr80h commands to work in 64 bit long mode 6m
- 49. Calling initializers of many subsystems we have refactored 4m
- 50. Creating a simple user program ready for 64-bit loading 7m
- 51. Loading our simple user program part 1 5m
- 52. Loading our simple user program part 2 5m
- 53. Remapping the PIC 12m
- 54. Rebuilding STDLIB to work with 64 bit long mode 13m
- 55. Re-enabling ELF files and making the loader work on long mode 6m
- 56. Filesystem and Disk bug fixes 20m
- 57. Refactoring our ELF32 loader to load ELF64 files 26m
- 58. Fixing a bug in the IDT and running our first ELF program in 64 bit mode 2m
- 59. Implementing the IRQ C code to allow us to enable or disable PIC interrupts 12m
- 60. Updating our keyboard driver to re-enable the keyboard IRQ + Testing shell.elf 4m
- 1. Understanding UEFI and EFI SDK 16m
- 2. Downloading and setting up EDK2 SDK 14m
- 3. Compiling and executing our EDK2 module 21m
- 4. The changes we will make to our filesystem and disk drivers 5m
- 5. Loading kernel.asm bootloader from UEFI 48m
- 6. Fixing kernel.asm to survive the UEFI boot process 10m
- 7. Being able to detect free memory regions again 22m
- 8. Solving unmapped kernel problem 5m
- 1. Writing code to read and decode the partition tables 24m
- 2. Creating the ability to have virtual disks that point to partitions 29m
- 3. Creating the ability to be able to read the volume name from a filesystem 11m
- 4. Building the krealloc function 23m
- 5. Path parsing symbolic link to system filesystem 6m
- 6. Compiling our GPT and calling gpt_init 4m
- 7. Improving our disk streamer 7m
- 8. FAT16 changes and running our user program again 6m
- 1. Graphics, Windows And Framebuffers 15m
- 2. Injecting the framebuffer pointers into our kernel from UEFI 22m
- 3. Graphic Foundations and Creating simple graphics in our kernel 1h 1m
- 4. Opening image files in our kernel part 1 image abstraction 28m
- 5. Opening image files in our kernel part 2 BMP image loader 35m
- 6. Drawing images to the screen 11m
- 7. The Font system explained 8m
- 8. Implementing the font system - part 1 27m
- 9. Implementing ability to redraw graphics to the framebuffer at a rectangle region 16m
- 10. Implementing the font system - part 2 11m
- 11. Drawing text to the screen 7m
- 12. Creating the terminal functionality - part 1 16m
- 13. Creating the terminal functionality - part 2 28m
- 14. Creating the terminal functionality - part 3 20m
- 15. Implementing graphics transparency and ignore keys and drawing of rectangles 7m
- 16. Creating the terminal functionality - part 4 14m
- 17. Redrawing the enitre background as black and testing our terminal 2m
- 18. Running programs in the shell and making fonts 5m
- 19. Module 1 summary 2m
- 0.00 instructor rating
- 1 courses
- Systems students worldwide
Daniel McCarthy
Learn from DragonZap instructors with practical, build-first lessons focused on systems, low-level programming, compilers, kernels, and real-world engineering fundamentals.
Student reviews
===== 26/03/29/sun 09:58 ===== Wow! Your lecture is the best. I learned about Kernel and bootloaders. Thank you very, very much!
.
Perfect
Thanks you for the course. It helped me learn and get confident in all aspects of Operating System. Thanks Daniel.
I watched a couple of videos and and feel interested in completing the course, I'm going after the certificate for my cv :)