RSSAmplifier

Blog

JBake

JBake Bootstrap Template

kamkow1lair.plRSS feed ↗14 posts

Latest posts

TCL scripting in userspace

In this blog post I d like to take you through the process of how I added a simple way of writing scripts in MOP3 in userspace. This side-quest was also an excuse for me to slack on the USB stack (EHCI/OHCI is still work in progress) and generally I needed a simple "quick-win", because of being way too busy with private life stuff. The code for today:…

New priority-based round-robin scheduler

Today I d like to show you, how I ve added priorities to MOP3 s round-robin scheduler! Code to follow along: https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/kernel/amd64/proc.c https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/kernel/proc/proc.c https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/kernel/proc/proc.h Motivation So far MOP3 was fine with a basic round-robin…

Adding DMA support to an IDE driver

In this article I d like to show you, how I ve added DMA support to MOP3 s IDE driver! Code to follow along: https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/kernel/device/storage/idedrv.c https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/kernel/device/storage/idedrv.h https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/kernel/device/pci/pci_ide.c Terminology PRD = Physical…

Kernel Big Lock Pattern

This is going to be a controversial post, but hear me out! Also, this posts relates to a previous one, so check it out too! https://www.kamkow1lair.pl/blog/MOP2/mutex-sync.html Synchronization A big portion of a working kernel is the synchronization code. In a fairly modern OS, you d want to support SMP or Symmetric Multiprocessing (multiple cores), so that the user experience doesn t feel clogged…

Fighting the BIOS (me vs. American Megatrends)

Hello! Recently MOP3 has received BIG updates: a PCI subsystem and an IDE driver, so now we can write to persistent storage and keep our files there! How awesome? Because of that, I needed to have a userspace utility app to manage drive partitions and filesystems. The app is called sdutil and it s code can be found here: https://git.kamkow1lair.pl/kamkow1/mop3/src/branch/master/sdutil . It s a…

Generic update

A lot has changed since last update The operating system now has: working userspace shell along with various utility commands mailing IPC system PS/2 keyboard driver graphical terminal FAT16/32 drivers There were a lot of changes made sort of at one moment, so that s why I haven t blogged about them. To have a shell you d need a terminal driver, to type commands - a keyboard driver and to glue all…

Running my kernel on real hardware

Developing a custom operating system is notoriously difficult. These days we have awesome developer tools such as QEMU or Bochs. Despite that, those tools can sometimes turn out to be faulty or simply not show the entire truth about the running OS - especially QEMU, which while works, is a little too loose and allows for some correctness issues to slip in (in regards to CPU features, stack…

Implementing TLS (Thread Local storage) for x86_64

In this article I d like to explore the implementation details of thread local storage on x86_64/amd64 for my operating system with compliance to System V ABI. full code is as always at: https://git.kamkow1lair.pl/kamkow1/MOP3 Preface We re going to implement the bare working minimum of the ABI, just enough to make thread keyword work in Clang and GCC. The spec is more complicated than that. We re…

Mutexes and process suspension in kernels

Hello! In this blog post I would like to share my thoughts and some implementation details about the mutex mechanism in MOP3 ! WAIT! MOP 3 ? Yes! MOP2 is undergoing a huge rewrite and redesign right now, due to me not being happy with some design choices of the system. This is mostly about writing SMP-first/SMP-friendly code. The rewrite turned out to be so big that it was just easier to start a…

FAT filesystem integration into MOP2

Hello, World! I would like to present to you FAT filesystem integration into the MOP2 operating system! This was possible thanks to fat_io_lib library by UltraEmbedded, because there s no way I m writing an entire FAT driver from scratch ;). Source for fat_io_lib : https://github.com/ultraembedded/fat_io_lib Needed changes and a "contextual" system Integrating fat_io_lib wasn t so straightforward…

MBus - in-kernel messaging system

In this article I would like to present to you MBus - a kernel-space messaging IPC mechanism for the MOP2 operating system. One-to-many messaging MBus is a one-to-many messaging system. This means that there s one sender/publisher and many readers/subscribers. Think of a YouTube channel - a person posts a video and their subscribers get a push notification that there s content to consume.…

TB shell scripting for MOP2

This post is about TB (ToolBox) - the shell interpreter for MOP2 operating system. Invoking applications Applications are invoked by providing an absolute path to the binary executable and the list of arguments. In MOP2 paths must be formatted as MOUNTPOINT:/path/to/my/file . All paths are absolute and MOP2 doesn t support relative paths (there s no concept of a CWD or current working directory).…

Intro to MOP2 programming

This is an introductory post into MOP2 (my-os-project2) user application programming. All source code (kernel, userspace and other files) are available at https://git.kamkow1lair.pl/kamkow1/my-os-project2 . Let s start by doing the most basic thing ever: quitting an application. AMD64 assembly Hello program in AMD64 assembly .section .text .global _start _start: // our application's entry point…

Hello World!

This is a hello world post! #include <stdio.h> int main(void) { printf("Hello World!\n"); return 0; } Enjoy the blog! More posts are coming in the near future!