Posted
In this episode of making your own OS, we will now start implementing C into our OS. Make sure to check out their wiki, as it is loaded with information on how to make your own OS.
Now, you will need the packages GCC and LD from MinGW, https://sourceforge.net/projects/mingw/ (If you're a linux user, everything will already be set up and you will be able to use the terminal with all of the commands already there, and if you're a Mac user, just install XCode and then use the terminal to compile things)
This thread will be a little different, as we will start new all over again (sorry for the ones who did everything step-by-step in the last episode)
All operating systems use bootloaders. Most of the bootloaders are made in ASM, known as Assembly. Assembly is an extreme Low-level programming language, but it gives you the most freedom, despite all of the other programming languages.
Remember the file bootsector.asm from the last episode? Well, now we will make a new file called kernel.c. But first, we will add some new code to bootsector.asm.
extern kernel_main
loop:
call kernel_main
jmp loop
times 510-($-$$) db 0
dw 0xaa55
The extern kernel_main part of the code says that there will be another file in the future that has a function named kernel_main. Later on you will find out how the two different programming languages interact with each other.
the call kernel_main part of the code simply calls the function from another file.
Now, we will make a new file called kernel.c.
Inside kernel.c, you will want to add this following code:
void kernel_main() {
/* We will start building the kernel in Part 3! */
}
Now, you will want to do on cmd prompt / terminal:
nasm bootsector.asm -o boot.o
gcc kernel.c -o kernel.o
ld boot.o kernel.o -o OS.bin
Part 3 coming very soon...
also pls join my discord it rilly helps me feed my children: https://discord.com/invite/nKwasWa62z
Contribute to Express, an open-source ROBLOX exploit written fully in C.
Replied
i made byte os now
is just a regular os but it has byte roblox exploit automatically installed
Cancel
Post
I am an artist.
Contribute to Express, an open-source ROBLOX exploit written fully in C.
Users viewing this thread:
( Members: 0, Guests: 1, Total: 1 )
Cancel
Post