Activity

CT5

I was able to fix the storage error that caused some errors since it would interrupt the whole thread. I was also able to add Async functions for it so that you can co_await them. The only issue is that now, Im getting this error. Im not exactly sure if its something I broke, or just another error.

Attachment
0
CT5

Shipped this project!

Hours: 11.53
Cookies: 🍪 119
Multiplier: 10.32 cookies/hr

I recreated the mod from scratch to support 1.21.11, and it now has support for Summer and Spring and has less bugs.

CT5

Ok, so its been a month, but I was able to get it working with some help. Now Im just facing issues with some Platform COM exception. Im not sure what its about yet, but ill have a look at that later. Im getting some errors on Windows.Data.JsonObject as well, but that can be easily fixed.

Attachment
0
CT5

tbh, I probably worked on this for more than 4h but thats fine. It took me a while to figure out which function to hook into, which would give me the optimal and best result. For Spring, it was pretty difficult, but then I just copied mc’s code for random tick and modified it to be faster in spring. And for Summer, I basically just copied winter, but except this time, when you went in water, you would get less dehydrated and if you went under shade, or inside a house, you would get less dehydrated. Also for Summer, the more armour you have on, the less time you will need to spend outdoors to get dehydrated. You can get hydrated again, by going in water.

Attachment
Attachment
0
CT5

I wanted to continue my Mod from #summer-of-making so I started by porting it to 1.21.11. Im not really sure how Java Bindings and stuff like that works, but Java seems pretty similar to cpp, except that you need to write more code. It was difficult to figure out what the old func names from 1.19 were renamed to. I didn’t think it would be too difficult, since 1.19 wasn’t that old, but a lot was changed. I was able to use the Yarn Mappings and MC Mappings website to figure out which classes to hook into. I was able to re-use some of the code from the old Seasons Mod, but I had to pretty much start over. I also fixed a bunch of the bugs that were there in the previous version, like in-consistent frostbite and stuff like that.

Attachment
0
CT5

I was able to use some winmd’s to get the runtime classes needed for Microsoft.Xbox.Services. It took a long time for me to translate all the runtime classes from DotPeek to midl3 and I had to convert all the Int GUIDs to Hex GUIDs using a simple JS Script that converted all the numbers to hex values.

Attachment
Attachment
0
CT5

Shipped this project!

Hours: 79.51
Cookies: 🍪 2164
Multiplier: 27.22 cookies/hr

I built an Operating System in C++ from Scratch making my own Kernel and EXT4 Kernel Drivers. The EXT4 Kernel Drivers were the hardest part to figure out but I was able to use the Linux Kernel Docs to finish it. I really like how Its turned out, and how it’s almost finished.

CT5

I haven’t worked on AstralOS for a long time, and I wanted to ship it since Im now working on WinDurango. Anyway, I created a simple input func for basicConsole. The irq handler then calls the input helper functions which add a char or remove a char or end the input. And then I was able to use the Input func to create the console which only does read and write for now.

Attachment
0
CT5

Ok, so now I need to add Windows.Xbox.Networking.SecureDeviceAssociationTemplate. Anyway, so I was able to add Windows.Xbox.Multiplayer.Party and fix the AddRef error I had because I had an incorrect vtable. I also added more stuff to Windows.Xbox.ApplicationModel.idl.

Attachment
Attachment
0
CT5

I was able to add Windows.Xbox.Storage.idl and make an xbox notification thing from imgui. After D3D11x is done, ill merge and implement the xb ui funcs. I also created ConnectedStorage so that it would work with multiple users. Anyway, I was also working on the Xbox Guide UI, so hopefully Ill finish it tomorrow.

Attachment
0
CT5

I was finally able to get to the D3D11x part in Minecraft so I don’t need to do anymore idl stuff for now at least. I was able to get the GUIDs from the era.vbi using vbidump and regspy.

Attachment
0
CT5

Implementing Windows.Xbox.Management.Deployment was pretty easy and repetitive. I had a linker issue where it would complain about the winrt Event Handler, which I was able to fix by adding #include <winrt/Windows.Foundation.h>. The Deployment idl looks interesting because of the licencing stuff inside it

Attachment
0
CT5

Today I was able to make implementations for Windows.Xbox.System.idl and Windows.Xbox.Input.idl. There were a few weird cpp compiler errors that I was able to fix. One of them required me to add winrt::event<winrt::Windows::Foundation::EventHandler<winrt::Windows::Xbox::Input::ControllerAddedEventArgs>> Controller::e_ControllerAdded{}; for static winrt::event’s. Most of the functionality is Stubbed but Ill test it with minecraft later.

Attachment
0
CT5

It took me a long time to write the idl for Windows.Xbox.Input and I had a few issues with midl. The docs weren’t really useful for writing in midl3. midl also didn’t have compiler errors for events so I spent a while looking for the issue only to realise that I added a { get; } for an event. Anyway, I think there is still a lot I havent done in the Input idl but it should be fine for now.

Attachment
0
CT5

Im still working on reversing Windows.Xbox.System.idl using Unity PDBs and resym. This tool helps a lot with reverse engineering. Ive commented out a lot of the functions because they rely on other runtimeclasses which I havent implemented yet.

Attachment
0
CT5

I was able to implement GameTransportControls and fix the logging issue that prevented it from logging to the file. It took me a long time to figure out what was wrong with the winrt cmake file bc it keep on erroring out with not being able to find “windows.prop”. I was able to fix it by removing some cmake code which was supposed to install cppwinrt.

Attachment
0
CT5

I was able to get Logging working today with Spdlog as well as fixing File and Directory and making the Initialise function in WinDurango.cpp in WinDurango.Common. I was also able to get the Demo working.

Attachment
0
CT5

I was able to finish WinRTDirectory and WinRTFile. It was difficult to find proper documentation online on how to read files, but I was able to use this MS documentation to figure it out. After that, I was able to test it in WinDurango.Testing and it had a few bugs which I was able to fix.

Attachment
0
CT5

So since we are doing a rewrite, I started working on the Testing project and the WinRT implementation of File and Directory which allows you to access and read files and dirs without having to worry about sandboxing. There will also be a Native implementation of File and Directory which is for linux. The testing project was really hard since it is incredibly difficult to build UWP WinRT apps on cmake. So I just used visual studio instead.

Attachment
0
CT5

I was able to get Sonic Mania to work the day before. Sonic Mania used some stubbed functions and DMACreateContextX which was part of the issue. It still gives me a Reconnect Controller Issue whenever I press a button.

Attachment
0
CT5

Im probably not going to work on the EXT4 Driver anymore, bc it was supposed to be a really basic driver, that can just read. And since it can read, we probably don’t need to do anything else. Also it can now create files. Im going to start working on multithreading tomorrow.

Attachment
0
CT5

So now you can List Directories and Create Dirs. I haven’t yet implemented creating a file (which is very easy) or removing files/dirs yet, so thats for tomorrow. I also noticed some other errors, like the List Dir not printing the right name. Right now, It is just stuck at closing the newly created dir, Ill fix that tomorrow or maybe even the day after because Im going to be taking a break;

Attachment
0
CT5

So I was able to fix the write function, except for the wrong block count in fsck. I still need to figure out how to create a file, and how to implement a create file function. There are also a few conditions I haven’t accounted for in the AddExtent function, because while adding an Extent seems easy, it is a difficult algorithm to implement.

Attachment
Attachment
0
CT5

I was able to fix the Write function, but the 7zip doesn’t show the full data that I wrote. When I looked at the fs in fsck, it gives me a bunch of random inodes that have weird flags and stuff. I think the Allocate Blocks Function is broken and is causing a bunch of random inodes to be written. Ill fix that tomorrow.

Attachment
0
CT5

So first, I added the code for Chown, Utimes and Chmod in the EXT4 Driver and then I added more functions in the VFS abstraction for better control over files and dirs. There still isn’t code to create dirs/files in the VFS abstraction, but at least there is code to write to files in the EXT4 and VFS abstractions. Ill finish off the Write func tomorrow.

Attachment
0
CT5

So I was able to move the mounting code from main.cpp to my VFS abstraction, and I also added a few fixes for ResolvePath. Then I was able to add some missing functions in the GPT Partition Driver to create the open function in my VFS abstraction.

Attachment
1

Comments

theinfamousben
theinfamousben 2 months ago

im confused, i love it

CT5

Ok, so I was able to fix the bug from earlier and I even found and fixed some other bugs. It works well now, but Im going to move the mounting code from main.cpp to the VFS abstraction in Filesystem.cpp.

Attachment
0
CT5

The photo shows that the kernel is crashing, but I’m not sure why. Anyway, Ill debug that tomorrow. I was able to fix the Driver System by splitting the Partition and Block Devices into Block Controllers and Devices and Partition Controllers and Devices.
Here is how it works now:

  • Block Controller
    • Block Device #1
      • Partition Controller
        • Partition Device #1
          • EXT4 Driver
        • Partition Device #2
          • EXT4 Driver
Attachment
2

Comments

captaintriton167
captaintriton167 2 months ago

That is very impressive. Are you writing it in C?

CT5
CT5 6 days ago

Yep, C++

CT5

So I looked at the DriverSystem and saw that it was pretty broken, so Im fixing that. First, Im splitting the Block Device into a Block Controller which makes multiple BlockDevices per drive. Im not fully done with it just yet, but ill probably finish it tomorrow. Ive gotten the DriverSystem.h file structs fixed.

Attachment
2

Comments

zwecc
zwecc 2 months ago

Cool! When will there be Desktop Environment? XD

CT5
CT5 6 days ago

Not sure yet, still need to add multithreading and stuff like that

CT5

So the GetExtents function wasn’t actually broken, I just had 2 variables with the same name, which the compiler hadn’t told me about. So once I fixed that it started working. I then used GetExtents in the Read function so that I could read large files like the usermode or the kernel. In the demo, you can see Ive just opened up hello.txt. I decided not to do more of the EXT4 Driver, since Im only going to be only reading anyway in the kernel. I’ve started the VFS abstration. Most of the code Ive written before,isn’t going to futureproof well, so Im going to rewrite it in another update. So after the VFS, I need to add multithreading and then add a simple usermode app.

Attachment
0
CT5

I was trying to fix the Read function today and turns out it was bc it was reading the wrong inode. So I fixed the ReadInode function and then it was able to read correctly. Then I added some code for reading when not using extents. After that I started to work on GetExtents so that I can easily read huge files using multiple Extents. The logic behind GetExtents is solid, but the function crashes when used with a kernel panic. Ill fix that tomorrow.

Attachment
0
CT5

Since I couldn’t find any documentation online on how extents work, I had to ask GPT for help since I couldn’t understand how the linux kernel did it. GPT kept saying you have to iterate extents by doing DBP + i, when instead you needed to do DBP + sizeof(ExtentHeader) + i * sizeof(Extent). I had a feeling that was the right way, but I wasn’t too sure. After I got that working, I was able to fix the ListDir func.

Attachment
0
CT5

I was able to figure out why the ListDir thing wasn’t working properly. But first I had to get Extents working for the ListDir func, so I got that working.

Attachment
1

Comments

lu2000luk
lu2000luk 3 months ago

The demo is kinda broken for me )=

CT5

I found a lot of bugs and inconsistencies when testing the OS for example when I wanted to add Opening and Reading Files in the driver or when I tried to fix ListDir, which is still somewhat broken btw. I decided to restart and look at the linux kernel documentation and code to understand EXT4 and get my Driver to work. So currently, I’ve re-done the Superblock, Inode and Block Group Descriptor structs and enums. I also noticed a bunch of fields I should’ve been using like the s_first_ino or s_rev_level. The superblock was also the wrong size, like having a uint64_t[32] array which would’ve really misaligned the superblock struct. I also added a ton of nice comments explaining how various parts of EXT4 work.

Attachment
0
CT5

Added CreateDir

The cool easter egg value I was putting into a reserved EXT4 OSVal2 var caused the whole thing to fail and caused some weird issues like corrupted creation time and corrupted ExtraBlocks. After I fixed that I realised that the InodeType Enums were wrong so I found the correct one from the Gitlab Page which helped me to enable Extents in my inode. After that I tested it with debugfs and it worked! Although List Dir Still doesnt work properly.

Attachment
0
CT5

I was following the OSDev Wiki before, but it only had stuff on EXT2 which was vastly different compared to EXT4. I underestimated how different those two filesystems were which caused a lot of issues. Today (23rd) I discovered that the Inode struct I was using was wrong for EXT4, so I found this nice Gitlab Page which explained how EXT4 works and the structs that were involved. Unfortunatly it didn’t tell me how to checksum things which was a big issue because fsck was complaining about checksums, so I had to look at the Linux Kernel Source. I still havent gotten to checksuming the Group Descriptors. I was able to checksum the superblock though. With the help of debugfs using this command sudo debugfs /dev/nbd0p2 I was able to identify issues with the Inode Table.

Attachment
0
CT5

tbh I can’t even bother to get this function working, and there is barely any info online or in the OSDev Wiki to understand how to create a dir in EXT4. Right now, it just creates a dir, but if you go inside, there are 2 of the dirs you just created and all the dirs in the parent.

Attachment
0
CT5

Ive gotten the Create Dir Func to work but it is very very buggy and Ill probably fix it tmrw. You can’t even boot the image after it modifies the fs once.

Attachment
0
CT5

Currently I’ve been working on the EXT4 Driver, one function at a time. Im still working on the CreateDir function, but here is the FindDir (Find in Directory) function I made.

Attachment
0