CraftyOS Development Blog

Welcome to my blog on CraftyOS.

  • This blog will follow my development of my OS for a school project, initially this will over a period of 16 weeks.
  • I will try to post once a week with my progress as requested by my IT teacher.

Last Entry for School Purposes

Final Timeline This is the final timeline reflecting what tasks I actually completed. You can go to original timeline to see the difference which are quite minor. Writing a rust BIOS application VGA Text Mode A testing suite Exceptions and Interrupts IDT / GDT Exception Handlers Timer Handler Keyboard Handler Paging / Memory Map Physical Memory Heap Allocator Cooperative Multitasking Futures Async Keyboard PCI Show all PCI devices Storage Read/Write raw bytes to hard drive Preemptive Multitasking Using a timer interrupt to switch tasks....

October 31, 2021 · CraftyDH

Break 2

As the assignment is due soon, I have started work on the project presentation instead of working on new features. Due to how complicated multitasking was my timeline was a little skewed and I will unfortunately not complete the deliverables of a filesystem or networking. However I believe that the added multitasking abilities and syscalls make up adequatly for the losses in functionality.

October 25, 2021 · CraftyDH

Syscalls!

What are syscalls Syscalls are a process in a lower privilege level to communicate with higher privilege level code such as the kernel. There are many models for implementing such syscalls, the way I have gone for at the moment is regisiter based. To call a syscall you must know the syscall number, and then pass the arguments to the next registers. Unfortunately this means I cannot use rust contructs such as Vec’s as only C safe values can be directly passed....

October 17, 2021 · CraftyDH

Preemptive Multitasking

Co-operative vs preemptive multitasking In my OS I have already implemented co-operative multitasking however there are a number of reasons why I wanted to implement preemptive multitasking. Firstly since each task could run for an infinite amount of time it would be terrible for one rogue process to bring down the entire system. Secondly in order for tasks such as keyboard and mouse to run I had to add yield_now().await() all around my code base to share time....

October 10, 2021 · CraftyDH

Holidays — Async/Await, Disk IO and PCI Enumeration

Multitasking via async/await Multitasking is an important step in making a functional OS. There are 2 models that I could employ, cooperative and preemptive multitasking. Cooperative is easier to implement because tasks voluntarily give up time to allow to scheduler to spawn the next task. Benefits of Cooperative multitasking include a smaller resource footprint because tasks can save what it needs before switching, whilst the preemptive model must save everything as the kernel has no way of knowing what the task will need to keep....

October 3, 2021 · CraftyDH

Assessment Break

As the assessment week is approaching I have decided to take a break until the holidays. This means that the timeline will be pushed backwards by at least 2 weeks, however I feel confident that I should be able to catch up and by the end of the holidays be back up to schedule.

September 13, 2021 · CraftyDH

Memory - Mapping and a Global Allocator

Memory Memory is an essential component to a functioning OS, it allows for dynamic content such as strings and other data types which need to be stored on the heap. Therefore mapping will first need to be implemented to be able to read and write to virtual memory locations which are stored at some other physical memory location. After this a Global Allocator which takes a page and builds a heap on it, for these purpose a linked list allocator will be used for allocations over 2 MiB, and a Fixed Size Allocator for smaller allocations allowing for fast allocations....

September 6, 2021 · CraftyDH

Interrupts - Timers and Keyboard

Interrupts Interrupts are essential to a computer functioning, they allow your keyboard and mouse to interrupt the CPU and tell it that an event is waiting. This means that when a program is running the kernel gets control of the CPU so that it can process the keyboard event. This also enables the CPU to tell us when we do something stupid such as dividing 0 by 0. Timeline In this week the interrupts and exceptions were quite easy to write with Phillop’s tutorials help....

August 29, 2021 · CraftyDH

Take 2, a fresh start...

Why must I restart? Well quite simply UEFI is a pain. But seriously I spend 72 hours rewriting and rewriting my interrupt handlers to no avail. I believe that the problem was that I could not setup paging correctly and as such caused general protection faults and as I could not handle these faults I wasted so much time. Therefore in order to catch up to my schedule I have chosen to follow Philipp Oppermann’s blog_os to completion and then implement the other features on top....

August 22, 2021 · CraftyDH

The beginnings of CraftyOS

Why make an OS? The purpose of this project is to learn how computers work at a basic level by programming a bare bones OS. This will help myself learn the various complexities behind the OS abstractions that are used in conventional programs. Additionally as this project is for a school project, I had the requirement of creating a digitial application in 16 weeks. With that in mind, I wanted to choose a complex topic where I could make something cool while learning another area of computer science....

August 8, 2021 · CraftyDH