You are browsing as a guest. Sign up (or log in) to start making projects!

Wheat Operating System (WheatOS)

  • 13 Devlogs
  • 30 Total hours

An Operating System with based on x86 for computers (might be AI-integrated)

Open comments for this post

9h 38m 45s logged

My bootloader Is Finished!!!

It loads into Protected Mode (32-bit) and Long Mode (64-bit), and then jumps to the kernel.

My Next Goal

My next goal is to work on my kernel. Can y’all give me some ideas about the kernel? What features should it have?

0
0
29
Open comments for this post

9h 26m 20s logged

Protected Mode (32-bit) Enabled

I got into protected mode in my stage 2 bootloader.

1. A20 Line

First, I have to enable the A20 line to give the computer permission to access more than 1MB memory.

2. E820 Memory Map

Next, I write a part of code that informs the computer of the safe physical memory access range (tells the computer about memory areas)

3. Global Descriptor Table (GDT)

Before switching to protected mode, the kernel has to know what memory areas is for what. That is why we have GDT to inform the kernel.

4. CR0.PE = 1

Finally, I enable protected mode through the register CR0.

0
0
8
Open comments for this post

4h 14m 30s logged

Stage 1 Rebuild

I rebuilt the Stage 1 bootloader in a new way. It successfully loaded into the Stage 2 bootloader, but I didn’t fully develop the Stage 2 bootloader.

Disk.asm

I made a new file named “disk.asm” to load data from the disk into memory. It will be used by both Stage 1 and 2 bootloaders.

0
0
42
Open comments for this post

28m 19s logged

Finished Stage 1

Everything in Stage 1 is done. It only works for x86 machines that have a BIOS from 1998 or later because it supports the feature that my Stage 1 bootloader has (Int 0x13, AH=0x42).

What’s Next?

I will work on the Stage 2 bootloader and load the machine into Long Mode (64-bit).

First of all is get the Real Mode setup.

0
0
73
Open comments for this post

48m 11s logged

Final of Stage 1, Beginning of Stage 2

I just found out that there are some final tasks I have to do in Stage 1 before I can completely switch to Stage 2.

What’s Wrong

I need to make sure the BIOS supports the function to switch to Stage 2

0
0
54
Open comments for this post

36m logged

Bootloader Stage 2 (still in progress)

After stage 1, I continue with stage 2, which will extend the memory limit, so the os can handle more complex tasks.

What Happened?

Surprisingly, I don’t know why it has an error.

disk_address_packet:
    db 0x10
    db 0
    dw 1
    dw 0x8000
    dw 0x0000
    dq 1

disk_error:
    mov si, disk_error_message
    call print_loop
    jmp hang
    ret

“disk_address_packet” and “disk_error” labels are to allow you to understand my screenshots more easily.

1
0
70
Open comments for this post

27m 25s logged

Switching to A New Virtual Machine

I have switched to a new virtual machine, QEMU, because I can compile and run my Assembly file (.asm) more quickly. My file will output “Loading into Protected Mode 32-bit” once it runs.😅 😅 😅

I am still stuck in Real Mode and still can’t get to Protected mode.

0
0
58
Open comments for this post

46m 20s logged

Trying to switch CPU mode in bootloader (Part 2)

Today, I am still stuck with the process of how to switch from Real Mode (16-bit) to Protected Mode (32-bit), but I think a little bit outside the box. Not only focused on A20, but I also researched the other parts in Real and Protected Mode.

0
0
68
Open comments for this post

47m 55s logged

Trying to switch CPU mode in bootloader

I’m currently working on the bootloader to make it from Real Mode (16-bit) to Protected Mode (32-bit)

I’m still stuck with the A20 gate. I need to learn more about Assembly syntax, so it will help me understand how my CPU actually works.

5
0
92
Open comments for this post

50m 54s logged

Shortcut for building files

I just made a shortcut today, so it will help me later in this project.

PowerShell file

I have added a PowerShell file to build a Binary file (.bin) and other files (.img, .vdi) from my main Assembly file (.asm).

& "C:\Program Files\NASM\nasm.exe" -f bin boot.asm -o boot.bin


del disk.img -ErrorAction SilentlyContinue
del disk.vdi -ErrorAction SilentlyContinue

$disk= New-Object byte[] (1474560)
[IO.File]::WriteAllBytes("disk.img", $disk)

$boot= [IO.File]::ReadAllBytes("boot.bin")
$disk= [IO.File]::ReadAllBytes("disk.img")
[Array]::Copy($boot, 0, $disk, 0, 512)
[IO.File]::WriteAllBytes("disk.img", $disk)

& "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" convertfromraw disk.img disk.vdi --format VDI
1
0
110

Delete project?

Are you sure you want to permanently delete this project? This action cannot be undone.

All devlogs, followers, and associated data will be removed.

Followers

Loading…