flat assembler
Message board for the users of flat assembler.

Index > OS Construction > How do I create a OS with assembly?

Author
Thread Post new topic Reply to topic
Loganvd



Joined: 04 Jul 2026
Posts: 1
Loganvd 04 Jul 2026, 22:54
How do I create a OS with assembly? I'm new to fasm, don't know how to make OSes with it yet.
Post 04 Jul 2026, 22:54
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 170
Location: Socket on motherboard
Core i7 05 Jul 2026, 09:08
If you're a beginner, start with something simpler.
Post 05 Jul 2026, 09:08
View user's profile Send private message Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 611
Location: Marseille/France
sylware 05 Jul 2026, 12:39
You need first to understand the hardware micro-architecture of CPUs.

That said, I suggest you look at RVA23, aka RISC-V since this is a 'cleaned up' micro-architecture (still with a lot of not really pertinent features, that to increase likelyness with the current mainstream full of technical debt micro-architectures).
Post 05 Jul 2026, 12:39
View user's profile Send private message Reply with quote
IsaacZ



Joined: 05 Dec 2025
Posts: 12
IsaacZ 08 Jul 2026, 20:26
I'm also a beginner, but I would recommend first learning how to create a solid bootloader, then get simple hardware information before anything else
Post 08 Jul 2026, 20:26
View user's profile Send private message Visit poster's website Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 611
Location: Marseille/France
sylware 08 Jul 2026, 20:29
IsaacZ wrote:
I'm also a beginner, but I would recommend first learning how to create a solid bootloader, then get simple hardware information before anything else


Then a choice has to be made: embedded uses static device trees, but PCs use UEFI/ACPI.
Post 08 Jul 2026, 20:29
View user's profile Send private message Reply with quote
bzt



Joined: 09 Nov 2018
Posts: 102
bzt 09 Jul 2026, 13:09
sylware wrote:
Then a choice has to be made: embedded uses static device trees, but PCs use UEFI/ACPI.
Not necessarily. I've created a single library that handles both: hwdet. No matter the input format, this provides a common output.

It's a single C header file, no memory allocation, no dependencies (not even libc), so should be trivial to port to Assembly (sorry about that, I've used C because I wanted it to be portable).
It handles about 99% of all DSDT I could find (including real machines) and actual RaspberryPi DTBs as well. It does not execute AML on-the-fly for security reasons, only interprets it to parse the hardware resources.

You can also find the full AML and FDT specifications in the repo if you want to implement these in Assembly from ground up.
Post 09 Jul 2026, 13:09
View user's profile Send private message Reply with quote
sylware



Joined: 23 Oct 2020
Posts: 611
Location: Marseille/France
sylware 10 Jul 2026, 10:14
You must run some ACPI byte code if you want the hardware properly initialized, or even some hardware configuration element can only be done with running that byte code.

I remember Linus T. about it, "designed by monkeys high on LSD".

Well, this summerize the state of hardware/software nowadays.
Post 10 Jul 2026, 10:14
View user's profile Send private message Reply with quote
bzt



Joined: 09 Nov 2018
Posts: 102
bzt 10 Jul 2026, 12:45
sylware wrote:
You must run some ACPI byte code if you want the hardware properly initialized, or even some hardware configuration element can only be done with running that byte code.
Not necessarily. I put lot of effort into my lib to interpret the AML structures natively as much as possible instead letting the bytecode do that to mitigate the security risks. You can get pretty far without bytecode. Yeah, this s*xx big time, not easy to implement, but doable. TBH, in reality there's no logic in AML that's not already implemented by device drivers.

Even if everything were shiny, you usually still can't run the provided bytecode because lots of machine's AML is buggy like hell. (On a side note, I guess the armada of buggy factory default AMLs is the main reason why the device drivers implement the required logic anyway, imho).

sylware wrote:
I remember Linus T. about it, "designed by monkeys high on LSD".
He was absolutely right. A hardware configuration should not need any virtual machine in the first place. I mean FDT works without it just fine.

sylware wrote:
Well, this summerize the state of hardware/software nowadays.
Sadly I must agree.
Post 10 Jul 2026, 12:45
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 170
Location: Socket on motherboard
Core i7 10 Jul 2026, 14:04
I think ACPI tables are the last thing an OS developer needs, once all the basic functionality is ready. That is, these are small, albeit important, details, such as power management for PNP devices.

During the POST process, any hardware must report its system requirements, and the BIOS stores them in the PCI-Config-Space table. These include the base addresses of devices in memory, their I/O port numbers, and so on, which are required by the system drivers. Many motherboard controllers also have hard-coded memory addresses, such as IO_APIC=0xFEC00000, LAPIC=0xFEE00000, as well as the first 256 CPU ports. All of this facilitates the collection of information about physical devices.
Post 10 Jul 2026, 14:04
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.