Contents Repository Introduction The APLIC Conclusion Repository This blog series refers to the code written here: https://github.com/sgmarz/riscv_msi. The APLIC specification (still in draft) is part of the Advanced Interrupt Architecture (AIA) specification, and it is kept here: https://github.com/riscv/riscv-aia. I am using AIA specification version 0.3.0-draft.31 to write this article. Introduction The advanced platform level interrupt […]| Stephen Marz
Contents Overview Repository Message Signaled Interrupts (MSI) Incoming MSI Controller (IMSIC) Conclusion What’s Next Overview Message signaled interrupts or MSIs describe a way to signal an interrupt without a dedicated interrupt request pin (IRQ). One of the most prevalent uses for MSIs is the PCI bus, and the PCI specification defines the MSI and MSI-X […]| Stephen Marz
Writing assembly is itself an art. When C, C++, or any other language is compiled, the compiler determines the art of writing assembly. However, this time, we will some of the techniques and decisions we can make to write these ourselves. We will use RISC-V to see how to design logic, write up the logic, […]| Stephen Marz
This post is part of a larger effort you can view over here: https://osblog.stephenmarz.com. Video Contents Overview Application Programmer’s Interface (API) Starting Routines System Calls Drawing Primitives Event Handling Start Our Game Game Loop PLAY Overview We last left off writing a graphics driver and an event driver for our operating system. We also added […]| Stephen Marz
This post is part of a longer OS tutorial which can be found here: https://osblog.stephenmarz.com Contents Introduction What is SATP? What is SFENCE.VMA? What is happening? The Translation Lookaside Buffer Conclusion References Introduction My last post garnered some attention by those telling me that I “forgot” to execute an SFENCE.VMA after I wrote to the […]| Stephen Marz
This is a continuation of an ongoing theme which is started here: https://osblog.stephenmarz.com. Contents What is Supervisor Mode? Why Supervisor Mode? Complications while in Supervisor Mode Complications with Interrupts Conclusion What is Supervisor Mode? My original OS Blog (see here: https://osblog.stephenmarz.com) ran the operating system in RISC-V’s machine mode, which is the most privileged mode […]| Stephen Marz
An operating system is used to make our job easier when using graphics. In our instance, in addition to everything else. In this post, we will be writing a GPU (graphics processing unit) driver using the VirtIO specification. In here, we will allow user applications to have a portion of the screen as RAM--with what is commonly known as a framebuffer.| Stephen Marz
Input devices give our operating system the ability to accept mouse and keyboard inputs from the graphical user interface (GUI). We originally used the UART (universal asynchronous receiver/transmitter) for console I/O, but we're high class now--we have a GUI! So, we will use the virtio protocol to communicate with a mouse and keyboard.| Stephen Marz
Static vs dynamic linking usually has to do with our tolerance for the size of our final executable. A static executable contains all code necessary to run the executable, so the operating system loads the executable into memory, and it’s off to the races. However, if we keep duplicating code over and over again, such as printf, then it starts to use up more and more space. So, a dynamic executable means that we only store stubs in the executable. Whenever we want to access printf, it goes ...| Stephen Marz
The standard library contains a ton of code that we don’t want to write ourselves, including printf, scanf, math functions, and so forth. So, we need to make sure our operating system can link to this library and everything “just works”. This post will show you how I linked our operating system to a standard library, newlib, and the trials and tribulations encountered in doing so.| Stephen Marz