- 5m
Developing a Multithreaded Kernel From Scratch: Part Two - Module Two
About this course
This course is the continuation of Part 2 Module 1, where we continued building the 32-bit PeachOS kernel, into a fully functioning 64-bit multitasking operating system. In Part 2 Module 2, we take the project to the next level by continuing the development from Module 1. By the end of this course you will have a fully functioning 64-bit operating system capable of GUI windows, task scheduling and more. Keep reading for the full details.
Part 2 - Module 2 (This Module)
Module 2 builds directly on the work from Module 1 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.
— Building a disk streamer cache to speed up program loading by 10x to 20x.
— 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 this module, 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
106 Lessons • 19h 47m estimated learning time- 30m
- 3. Implementing FCLOSE in userland 10m
- 4. Implementing FREAD in userland 10m
- 5. Improving our memory managment system for processes - part 1 26m
- 6. Improving our memory managment system for processes - part 2 23m
- 7. Compiling and testing FREAD 7m
- 8. Implementing FSEEK in userland 10m
- 9. Implementing FSTAT in userland 13m
- 10. Moving the task paging descriptor into the process 7m
- 11. Making the process list use vectors 11m
- 12. Making the process_realloc function 16m
- 13. Creating some essential graphics functions 37m
- 14. The Window System In Detail 16m
- 15. Building the Window header files 14m
- 16. Building the Window source files part 1 16m
- 17. Building the Window source files part 2 20m
- 18. Building the Window source files part 3 14m
- 19. Building the Window source files part 4 9m
- 20. Building the Window source files part 5 12m
- 21. Understanding CPUID 4m
- 22. Implementing CPUID in our kernel 6m
- 23. Understanding the TSC Frequency And Delay Functionality 5m
- 24. Using the TSC Frequency And Implementing Delay Functionality 18m
- 25. Using the TSC Frequency And Implementing Delay Functionality Part 2 10m
- 26. Using the TSC Frequency And Implementing Delay Functionality Part 3 2m
- 27. Understanding the mouse 11m
- 28. Building mouse abstraction 22m
- 29. Building mouse abstraction - Part 2 11m
- 30. Implementing window_position_set function 13m
- 31. Implementing graphics_info_recalculate 5m
- 32. Implementing window_redraw and testing our windows 4m
- 33. Implementing the PS2 mouse 20m
- 34. Implementing the PS2 mouse - Part 2 18m
- 35. Implementing the PS2 mouse - Part 3 4m
- 36. Implementing the PS2 mouse - Part 4 , Testing the mouse 3m
- 37. Implementing click handlers for graphics 21m
- 38. Implementing move handlers for graphics 5m
- 39. Registering mouse event listeners in windows and implementing the click handler 8m
- 40. Implementing the window_click function 3m
- 41. Implementing the window helper functions 12m
- 42. Pushing events for focus and unfocus 3m
- 43. Dealing with title bar clicks 7m
- 44. Moving windows with the mouse 8m
- 45. Fixing compile errors with the graphics and windows 4m
- 46. Fixing common runtime errors identified in graphical and window system 6m
- 47. Testing our windows 2m
- 48. The translation layer for graphics and windows in user space 12m
- 49. Creating userland pointers 13m
- 50. Creating windows from userspace - part one 16m
- 51. Creating windows from userspace - part two 9m
- 52. Creating windows from userspace - part three 7m
- 53. Creating windows from userspace - part four 4m
- 54. Diverting stdout to a window 12m
- 55. The link between kernel window events and userspace 8m
- 56. Creating the window event functionality for processes - part one 13m
- 57. Creating the window event functionality for processes - part two 7m
- 58. Creating the window event functionality for processes - part three 18m
- 59. Creating the isr80h function to get events in user space 6m
- 60. Calling the isr80h get event function from userspace 8m
- 61. Accessing the graphics info of a window from userspace 15m
- 62. Getting the pixels buffer of a graphics info entity to use in userspace 19m
- 63. Creating ability for user space to redraw windows 4m
- 64. Compiling our changes 4m
- 65. Testing the drawing of pixels in our userspace application 9m
- 66. Binding the window redraw to ISR80H 2m
- 67. Creating relative graphics from userspace 13m
- 68. Redrawing window regions in userspace 6m
- 69. Updating window properties from userspace 11m
- 70. Implementing keyboard events and handlers 16m
- 71. Implementing the window keyboard listener 8m
- 72. Understanding PCI 31m
- 73. Implementing the PCI header files 16m
- 74. Implementing the PCI source files part one 27m
- 75. Implementing the PCI source files part two 24m
- 76. Implementing the PCI source files part three 26m
- 77. Implementing the PCI source files part four 4m
- 78. Upgraded disk abstraction and disk drivers 5m
- 79. Attaching hardware disk to the disk structure and basic driver metadata 7m
- 80. Creating the disk driver header file 9m
- 81. Creating the disk driver source file 13m
- 82. Rewriting our disk code to work with the disk driver abstraction 8m
- 83. Implementing the pata disk driver header file 4m
- 84. Implementing the pata disk driver source file 26m
- 85. Finalizing and testing our pata driver 4m
- 86. All About NVMe 24m
- 87. Implementing the NVME header file 12m
- 88. Implementing the NVME source file - part one 31m
- 89. Implementing the NVME source file - part two 28m
- 90. Implementing the NVME source file - part three 19m
- 91. Implementing the NVME source file - part four compile and testing 8m
- 92. Fixing the keyboard events on userspace 2m
- 93. Implementing ability for tasks to sleep 8m
- 94. Implementing ability for tasks to sleep in userspace 13m
- 95. Implementing ability for tasks to sleep in userspace part two 2m
- 96. Rewriting the makefiles 5m
- 97. Fixing process realloc bug 2m
- 98. Calling int 0x80 in fclose 1m
- 99. Implementing the disk stream cache header files 16m
- 100. Implementing the disk stream cache source files - part one 13m
- 101. Implementing the disk stream cache source files - part two 20m
- 102. Implementing the disk stream cache source files - part three 4m
- 103. Implementing the disk stream cache source files - part four 2m
- 104. Installing dependency libraries for our userspace and running the calculator 9m
- 105. Explaining how to use the GUI SDK 23m
- 106. Rules for contributing 6m
- 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/04/05/sun 14:00 ===== Wow! Your lecture is the Fantastic. I learned about OS, Kernel, bootloader, Asm, Compiler, etc ... . I think that Now I am a Software Engineer! Very Very thank you!