- 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- 5. Cloning PeachOS and preparing our project 7m
- 6. How do you get to long mode 12m
- 7. Rewriting our bootloader to get to 64 bit long mode 34m
- 8. Getting from kernel.asm back to kernel.c in long mode 12m
- 9. Restoring simple terminal functionality 4m
- 10. Restoring heap functionality 8m
- 11. Changing pages from 2MB to 4KB 12m
- 12. Restoring and Improving Page Mapping Systems In Our C Code - Part One 20m
- 13. Restoring and Improving Page Mapping Systems In Our C Code - Part two 50m
- 14. Restructuring build files 5m
- 15. Abstracting out kernel paging functionality 4m
- 16. Allowing kernel heap to have a dynamic size 15m
- 17. E820 Memory Maps 7m
- 18. Building the E820 Memory Map functionality 23m
- 19. Multi-heap explained 12m
- 20. Building our multi-heap - Part 1 48m
- 21. Page Mapping Present only available E820 memory 7m
- 22. Building our multi-heap - Part 2 7m
- 23. Building our multi-heap - Part 3 17m
- 24. Building our multi-heap - Part 4 11m
- 25. Building our multi-heap - Part 5 15m
- 26. Creating callback handlers for our individual heaps 8m
- 27. Building our multi-heap - Part 6 19m
- 28. Building our multi-heap - Part 7 16m
- 29. Building our multi-heap - Part 8 13m
- 30. Building our multi-heap - Part 9 26m
- 31. Implementing the paging_get and missing paging functions 11m
- 32. Calling multiheap_ready 3m
- 33. Reimplementing the IO to work for 64 bit 9m
- 34. Loading more sectors of our kernel in boot.asm 1m
- 35. 64 Bit pushad and popad and making IDT 64 bit 4m
- 36. Remaking idt.asm to work with 64-bit code 5m
- 37. Remaking idt.c to work with 64-bit code 14m
- 38. Testing our upgraded 64 bit idt 8m
- 39. Adding user segment descriptors to the GDT 3m
- 40. Rebuilding the task system to be 64-bit 21m
- 41. Rebuilding the task system to be 64-bit - Part two 6m
- 42. Rebuilding the process system to be 64 bit 6m
- 43. Implementing paging_desc_free in paging.c 7m
- 44. Implementing kernel_desc and moving paging prototype function 2m
- 45. Testing our changes 6m
- 46. Bringing FAT16 into 64 bit mode 3m
- 47. Bringing the disk functionality into 64 bit mode 2m
- 48. Bringing process functionality into 64 bit mode 2m
- 49. Building GDT and TSS C Code 15m
- 50. Finalizing TSS code and Initializing it in the kernel 19m
- 51. Creating GDT Descriptors for TSS 3m
- 52. Restoring the disabled IDT functionality 5m
- 53. Restoring the keyboard 3m
- 54. Registering the isr80h commands 5m
- 55. Loading the TSS 3m
- 56. Refactoring the isr80h commands to work in 64 bit long mode 6m
- 57. Calling initializers of many subsystems we have refactored 4m
- 58. Creating a simple user program ready for 64-bit loading 7m
- 59. Loading our simple user program part 1 5m
- 60. Loading our simple user program part 2 5m
- 61. Remapping the PIC 12m
- 62. Rebuilding STDLIB to work with 64 bit long mode 13m
- 63. Re-enabling ELF files and making the loader work on long mode 6m
- 64. Filesystem and Disk bug fixes 20m
- 65. Refactoring our ELF32 loader to load ELF64 files 26m
- 66. Fixing a bug in the IDT and running our first ELF program in 64 bit mode 2m
- 67. Implementing the IRQ C code to allow us to enable or disable PIC interrupts 12m
- 68. Updating our keyboard driver to re-enable the keyboard IRQ + Testing shell.elf 4m
- 69. Understanding UEFI and EFI SDK 16m
- 70. Downloading and setting up EDK2 SDK 14m
- 71. Compiling and executing our EDK2 module 21m
- 72. The changes we will make to our filesystem and disk drivers 5m
- 73. Loading kernel.asm bootloader from UEFI 48m
- 74. Fixing kernel.asm to survive the UEFI boot process 10m
- 75. Being able to detect free memory regions again 22m
- 76. Solving unmapped kernel problem 5m
- 77. Writing code to read and decode the partition tables 24m
- 78. Creating the ability to have virtual disks that point to partitions 29m
- 79. Creating the ability to be able to read the volume name from a filesystem 11m
- 80. Building the krealloc function 23m
- 81. Path parsing symbolic link to system filesystem 6m
- 82. Compiling our GPT and calling gpt_init 4m
- 83. Improving our disk streamer 7m
- 84. FAT16 changes and running our user program again 6m
- 85. Graphics, Windows And Framebuffers 15m
- 86. Injecting the framebuffer pointers into our kernel from UEFI 22m
- 87. Graphic Foundations and Creating simple graphics in our kernel 1h 1m
- 88. Opening image files in our kernel part 1 image abstraction 28m
- 89. Opening image files in our kernel part 2 BMP image loader 35m
- 90. Drawing images to the screen 11m
- 91. The Font system explained 8m
- 92. Implementing the font system - part 1 27m
- 93. Implementing ability to redraw graphics to the framebuffer at a rectangle region 16m
- 94. Implementing the font system - part 2 11m
- 95. Drawing text to the screen 7m
- 96. Creating the terminal functionality - part 1 16m
- 97. Creating the terminal functionality - part 2 28m
- 98. Creating the terminal functionality - part 3 20m
- 99. Implementing graphics transparency and ignore keys and drawing of rectangles 7m
- 100. Creating the terminal functionality - part 4 14m
- 101. Redrawing the enitre background as black and testing our terminal 2m
- 102. Running programs in the shell and making fonts 5m
- 103. Module 1 summary 2m
- 4.90 instructor rating
- 18 courses
- 1,418 students worldwide
Daniel McCarthy
Daniel McCarthy is a seasoned software engineer, boasting an impressive career spanning over 14 years in the industry. Holding a Master's Degree in Advanced Computer Science from Cardiff Metropolitan University, his broad spectrum of experience encompasses everything from web development to complex compiler and interpreter development.
Daniel has honed his skills in bootloader and kernel development. In testament to his proficiency in the field, he has designed two proprietary programming languages: Craft, a general-purpose language, and Marble, a web-focused language akin to PHP. Moreover, he has successfully developed compilers for the C programming language.
A testament to his versatility, Daniel demonstrates proficiency in an extensive list of programming languages that includes C, C++, Java, x86 Assembly language, PIC assembly, SQL, PHP, HTML5, JavaScript, CSS, and of course, his own creations, Craft and Marble.
His professional portfolio also includes the development of Linux kernel modules, a task he has executed with proficiency in a professional context. Currently, Daniel is channeling his wealth of experience and expertise into the education sector, with the aim of nurturing the next generation of professional software engineers.
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 :)