Astral OS

Astral OS Used AI

29 devlogs
128h 42m
•  Ship certified
Created by CT5

A simple OS made in C++. It includes a lot of features, like a hybrid kernel (eventually) and a multi partition os. The code contains comments showing how everything works and which parts are from other sources.

Timeline

Earned sticker

I fixed a few errors that I had before which were really really difficult to debug. The AHCI Driver was really hard to debug because there wasn't enough viable information online or on the osdev wiki. The OSDev Wiki just gave me a few pointers and a checklist to follow. I found a lot of the defines from online documentation from different websites, so you'll see a lot of sourcing there. I was able to also read a bunch of sectors. I did face an issue with the IDE Driver which I had here, which was that reading sectors wouldn't work and would give nothing in the buffers. But I found this good forum on the OSDev Wiki that helped a lot.

Update attachment
Earned sticker
CT5
CT5
7h 56m 2 days ago

For some reason, VBOX and QEMU don't say that the device is AHCI but instead say that is an IDE Controller, so I switched to QEMU because it had PCIe and the MCFG table would
tell me exactly what type of device each one is. To migrate to QEMU, I needed to fix a few parts of my frankenstein bootloader so that QEMU would run it without issues.
I have written up a whole 62 line comment on how AHCI works, so that others could understand what I am doing. I should be able to finish the AHCI Controller Driver tomorrow.
Here is a screenshot of what I have so far.

Update attachment
Earned sticker
CT5
CT5
6h 33m 3 days ago

I added an PIT class for the APIC timer so that I could test the sleep functionality and use sleep for waiting in the IDE Controller. The example shows the IDE Driver determining weather a drive is present or not and reading the drive's buffer from LBA 0.

Update attachment
Earned sticker
CT5
CT5
2h 19m 5 days ago

I was able to fix the Driver Issue, turns out it was because it was because I passed DriverServices Incorrectly. I was able to fix it but then I realised that VBOX doesn't expose AHCI stuff in PCI so I'd have to use the IDE mode. So now Im making an IDE Controller.

Update attachment
CT5
CT5
10h 13m 8 days ago

I was finally able to get the Driver working. Turns out it was due to an error in the ELF Parser. I added a dynamic elf parser and a relocator so that it executes the driver correctly.

Update attachment

I didn't do a lot today, but I was able to reorganise my messy code. I was able to create a String Class that allows you to easily cat strings without 10+ lines of code. I was also able to add a Driver Registration function in Driver Services for the Driver to register a Base Driver. I just need to figure out how Im going to make the Driver.

Update attachment
CT5
CT5
3h 37m 20 days ago

At least making the ELF and DriverManager Class wasn't that hard. Since I had already made the Driver Manager Class before, it was pretty smooth. I needed to make my own ELF loader though. Anyway, I also got the DriverServices to work and print out smth.

Update attachment
CT5
CT5
3h 12m 24 days ago

Turns out I wasted around 20 hours for nothing on my Arrays. The problem was actually due to my bad malloc setup. Anyway, now that I got that over with, I was also able to use GPT to make a simple recursive test for my list func. Also, the rewrote the list func without GPT because I suspected that was the issue.

Update attachment
CT5
CT5
4h 22m 26 days ago

I was able to make my own Linked List Array with the help of AI with DEBUGGING. Only Debugging. It took me a while, because CMake didn't update the binary,

Update attachment

It took a while for me to realize that creating arrays inside arrays aren't a good idea because it could overwrite one another. Anyway, I was able to get that fixed and I was also be able to get a simple file exists function to work. Here is a quick demo for the Initrd and the Array.

Update attachment

So far, Ive added a KernelDrivers Dir and given it functionality to put the drivers in initrd. Im trying to redo the Initial Ram FS system without AI, because the old one used AI fully.

Update attachment

Ship 1

1 payout of shell 1053.0 shells

CT5

2 months ago

CT5 Covers 18 devlogs and 72h 3m
CT5
CT5
1h 55m 2 months ago

I added a simple Block Device Class and fixed the PCI and PCIe classes. NOTE: PCIe IS UNTESTED.

Update attachment
CT5
CT5
10h 44m 2 months ago

I fixed the Page Frame Allocator, along with trying to fix other things, which failed.
Before, the Kernel required 4GB Minimum. After the Page Frame Allocator Fix, it now requires at least 512MB of ram. Its possible to get 256MB of ram, but it crashes.

Update attachment

I tried to optimize my kernel but every way I tried, I hit a dead end. At first, I was mapping every part of the ram, which caused my kernel to be unusable with any ram under 8G. Anyway, I was able to create a simple initrd cpio reader which can read the initrd from by uefi bootloader.

Update attachment
CT5
CT5
12h 3m 2 months ago

Im still having trouble with mapping and the stack. It fails after paging is enabled. Currently im disassembling the kernel to find the problem.

Update attachment
CT5
CT5
8h 57m 3 months ago

Turns out VirtualBox doesn't support PCIe, but PCI works. After a long time, I have finally ported my kernel to Higher Half. Mot of the addresses start at 0xFFFFFFFF00000000 and 0xFFFFFFFF80000000. This is to make the kernel more secure and to have full support for 32-bit apps.

Update attachment
CT5
CT5
2h 20m 3 months ago

For some reason, it cant find the MCFG table, possibly because my VM doesn't have PCIe Support.

Update attachment

Ok, the PCI took about 7 hours, because I partially implemented the PCI last time and now I have finished it. I still have to make the PCIe and MSIx, but that's for tomorrow.

Update attachment
CT5
CT5
5h 19m 3 months ago

Sorry for the Late Devlog. I needed to transfer files to my new PC and I also had issues with WSL. Anyways, I added the Heap Allocator and I partially made the PCI. Im hoping to finish it today.

Update attachment
CT5
CT5
7h 15m 3 months ago

Ok, so the ACPI was a pain to implement. The UEFI protocol seems to not have given me the exact correct Address for the RSDP. Once I realised that, there was another problem because of the unaligned XSDT.

Update attachment

I was finally able to test my I/O APIC by creating a Simple Keyboard Driver. I am going to implement a Keyboard Driver after I get my filesystem sorted. Then I can finally find a keyboard driver and Load it.

Update attachment
CT5
CT5
2h 38m 3 months ago

I added an I/O APIC. I just need to test this out. Hopefully this goes well.

Update attachment

I finally fixed the APIC and I also added the PIC class so that I can use that instead of the make shift remapping in the APIC class.

Update attachment
CT5
CT5
2h 36m 3 months ago

Still facing issues with the APIC.

Update attachment
CT5
CT5
2h 39m 3 months ago

Took me a while, but I got the APIC working. Now I just need to figure out how to test this thing.

Update attachment
CT5
CT5
4h 13m 3 months ago

I finally got the IDT working. Turns out you must separate the assembly sections to prevent the ISR's (Exception code) from running. I can now get exceptions for doing 1 / 0 and stuff like that. Although, writing to the kernel .text seems to not cause an exception. If you want a build, just ask me in Slack.

Update attachment
CT5
CT5
1h 42m 3 months ago

I added GDT. The layout uses a null Descriptor, Kernel Mode Code Segment, Kernel Mode Data Segment, User Mode Code Segment and a User Mode Data Segment.

Update attachment

Started on the GDT (Global Descriptor Table). Created the structs for the Segment Descriptor.

Update attachment
CT5
CT5
1h 10m 3 months ago

Tested Paging and Fixed Bugs with Page Frame Allocator and Page Table Manager.

Update attachment
fluffy fluffy 3 months ago

Haiii! I see you’re doing an os project as well, theres only a few I’ve seen so far, you should message me, maybe we can work together! :3