raca banner

raca

27 devlogs
65h 51m 32s

A simple OS written in rust, deeply inspired by zircon.

Demo Repository

Loading README...

239873059

I have made PCIe work. But limine somehow doesn’t map PCIe mmios. So I stil need an elegant way to map it manually.

Attachment
0
239873059

Shipped this project!

I thought this project would be easy, because I have written many OS projects, and my goal is to make it run a simple shell and a file system. But turned out it was far more difficult than I expected. I was forced to learn about loongarch64 more deeply, and I finally learnt how to debug the kernel with rust-lldb. However, I’m proud to say that my OS might have the best loongarch64 support in all rust-written operating systems!

239873059

Now I have finally added a terminal, and I will add pcie and a keyboard driver.

Attachment
0
239873059

I really don’t know why this is broken, maybe I need the frame buffer to test sys_write_vmo.

Attachment
0
239873059

I removed some members in ProcessStartInfo, so that user programs can load other programs more easily.

Attachment
0
239873059

I have added exit syscall, and the bug of timer is made sure to be fixed. I just realized that the performance of software simulation is not that good, so using periodic mode isn’t very reasonable, because operations in the kernel requires a lot of time, so after entering user mode, it might immediately interrupt and exit from it.

Attachment
0
239873059

Although the kernel can run 11 syscalls normally now, enabling interrupt in user mode is causing a great issue. This makes QEMU run really slowly, and I can’t have realized that it is indeed running if I didn’t print ip. I don’t understand what is happening, because the timer implementation for loongarch is QEMU is very similar to other timers for other platforms.

Attachment
0
239873059

Now I can be sure that multitask and user mode support is robust enough! I added idle thread and improved performance slightly.

Attachment
0
239873059

I’ve tried hard, but power off and reboot simply don’t work. After looking up in Linux’s source code, I learnt that in LoongArch, you are not supposed to use ACPI to shutdown the machine. Instead, you should just kill all the process, and then simply idle. But I don’t understand why reboot is not working. I even added instructions to write back caches manually.

Attachment
0
239873059

After a lot of hard work, I finally made user boot work! But now the code is really messy, with cfg everywhere. I think I will clean up the code before I push it onto the repository.

Attachment
0
239873059

I’ve added a -d or –debug option for builder’s run sub command, so that you can debug the kernel.

Attachment
Attachment
0
239873059

I removed makefile and used xtask instead. And I have implemented multitask. Tomorrow I will add user space support.

Attachment
0
239873059

I have added heap, acpi and a trap handler to kernel_hal. But now kernel_hal is really messy. I think I should clean up the code.

Attachment
0
239873059

I’ve removed the makefile and rewrote builder to support the functionalities. This requires less dependencies.

Attachment
Attachment
Attachment
0
239873059

After trying really hard, I’ve given up fixing build system with cargo, so I wrote a make file. Now it works perfectly.

Attachment
Attachment
Attachment
0
239873059

I successfully made kernel run again. Then I shall start to fix build system and implement multitask.

Attachment
0
239873059

I tried really hard to make syscall work, but it’s just not working. So I am giving up further support of libOS, and I’m going to leave it as some simple implementation to make unit test work.

Attachment
0
239873059

I have added a syscall handler. Tomorrow I will start to implement syscalls.

Attachment
Attachment
0
239873059

I found many bugs when I tried to add a vDSO mapper. Now, after hard work, I successfully fixed all the bugs I found out and added a vDSO mapper. All the tests are passing now.

Attachment
Attachment
0
239873059

I have added vdso, and I am trying to support loading it. After that, we will be able to provide user programs with syscalls, and that we can start to make more kernel objects and writing userboot.

Attachment
Attachment
0
239873059

I have added multitask support for libOS! This is based on async rust. Next I will start to learn about vDSO and provide syscalls!

Attachment
0
239873059

I refactored kernel object declarations to improve flexibility. And I have also added Thread kernel object, and I will start to implement simple multitask tomorrow.

Attachment
Attachment
0
239873059

I have added VMAR children support, so it should be user-friendly now.

Attachment
0
239873059

I’ve added VMAR and VMO, but they still require more functionalities to become user-friendly. Anyway, racaOS is now supported to run as a libOS on Linux!

Attachment
Attachment
0
239873059

I am going to support LibOS! This will enable us to test our operating system on linux, and it avoids breaking unit tests.

Attachment
0
239873059

We’ve added two kernel objects, process and channel. The next step will to implement more functions, and we will make use of kernel-hal tomorrow.

Attachment
0
239873059

I turned back to rust. Now I am going to implement my design.

Attachment
0
239873059

I’m trying really hard to parse ACPI tables. But the address of the first sdt is invalid for some unknown reasons.

Attachment
0