OS development

Posts 112 of 12 · Page 1 of 1
OS development
So I've been creating user space apps for a little over 5 years, and I thought it was time to test my skills for the ultimate test.
For simplicity in the beginning, I'm going to have GRUB be my bootloader for sake of ease, so I can do more work on the kernel than just trying to get it to boot.

But for fun, I just dusted my assembly abilities and created a simple bootloader that loads the next sector into memory and executes from there.

Sectors are loaded into ES:BX which in this case is 0x1000:0. Just jumped there and it works

Right now I'm working on the monitor part of the kernel in 32 bit C. I made a bad habit by being so dependent on bios and dos interrupts for everything, but I guess it's time to break old habits.

Either way, I just created what's below for fun, just to brush up my assembly again and get into the mode of low levelness again


wish me luck on this journey
Make your own bootloader, it's not that hard.
Quote Originally Posted by Void View Post
Make your own bootloader, it's not that hard.
Yeah, I guess that's a good idea. I actually have a pretty concrete idea on how to implement it too.

Alright, thanks

Just gotta work on implementing FAT12 Can't be too hard considering how well it's documented.

Alright, coding.
Props Patrick. Maybe it's time for me to dive off the userland bandwagon too . I took a look at writing some drivers but didn't have anything I needed them for so I couldn't be fucked BSoDing the shit out of myself for no gain :3
Update 3: Realized there was a total fatal flaw in my boot loader, causing it to crash for any file larger than 512 bytes, so with the reference to some guides I ended up completely rewriting it

But now It loads any size file, so yay

32/I is just a temporary name until I can think of something better, but I think it sounds elite as is. 32 bit control program for x86 intels (cough totally didn't rip off control program for microcomputers cp/m cough cough)

so yeah, implementing the A20 line and such. Have much left on my todo list
Quote Originally Posted by rtemis View Post

Right now I'm working on the monitor part of the kernel in 32 bit C. I made a bad habit by being so dependent on bios and dos interrupts for everything, but I guess it's time to break old habits.
That probably isn't a great idea. Graphics are _literally_ the last part of your OS, and depending on the kernel architecture you're going for, it probably isn't even going to be apart of your kernel. (I.e, it will probably be a driver). It is possible to start with the graphics etc, but you will probably be reinventing the wheel about a dozen times if you work your way from the top to the bottom.

A kernel dev. team I know went straight to FS development and they have tons of redundancies in their code because of it (i.e, they didn't have a memory manager or suballocator that did x, so the reimplemented 'x' in their display driver)

The order of focus for you IMO should be:
Setup your Interrupt Service Routines (at least a template) for devices such as the keyboard & Programmable Interrupts Controller (You'll use it in the near future)
Memory Manager (Virtual Memory, either paged or segmented [I would go with paged])
Multi-threading
Virtual File-System
Executable image format and an executable image loader.
Some filesystem driver that can be mounted on your VFS
Finish up memory paging by implementing the ability to cache memory pages onto disk.

I probably missed a couple of steps, but once you get that done, you have a kernel that is ready for things like graphics drivers and GUI management.
Quote Originally Posted by radnomguywfq3 View Post
That probably isn't a great idea. Graphics are _literally_ the last part of your OS, and depending on the kernel architecture you're going for, it probably isn't even going to be apart of your kernel. (I.e, it will probably be a driver). It is possible to start with the graphics etc, but you will probably be reinventing the wheel about a dozen times if you work your way from the top to the bottom.

A kernel dev. team I know went straight to FS development and they have tons of redundancies in their code because of it (i.e, they didn't have a memory manager or suballocator that did x, so the reimplemented 'x' in their display driver)

The order of focus for you IMO should be:
Setup your Interrupt Service Routines (at least a template) for devices such as the keyboard & Programmable Interrupts Controller (You'll use it in the near future)
Memory Manager (Virtual Memory, either paged or segmented [I would go with paged])
Multi-threading
Virtual File-System
Executable image format and an executable image loader.
Some filesystem driver that can be mounted on your VFS
Finish up memory paging by implementing the ability to cache memory pages onto disk.

I probably missed a couple of steps, but once you get that done, you have a kernel that is ready for things like graphics drivers and GUI management.
Sorry for cauusing any confusion, but I meant just printing text (hex, decimal, ascii) by writing to video memory so it can help debugging by dumping registers and such to the screen, and setting up a basic CLI so I can test various things
Nothing big like a GUI or graphics drivers. Sorry for the miscommunication, I realize saying "monitor part" was probably not the best wording xD
UPDATE NUMBAH FOUR!!

Implemented a Hex to Decimal to Ascii ability so I can get stuff like free RAM and display it.
Implemented probing free low ram (lulz 3 lines of code) but today I didn't make much progress

Here's a gif
Quote Originally Posted by rtemis View Post
UPDATE NUMBAH FOUR!!

Implemented a Hex to Decimal to Ascii ability so I can get stuff like free RAM and display it.
Implemented probing free low ram (lulz 3 lines of code) but today I didn't make much progress

Here's a gif
Looks like shit and I hate you.
just kidding, much lub
Quote Originally Posted by rtemis View Post
UPDATE NUMBAH FOUR!!

Implemented a Hex to Decimal to Ascii ability so I can get stuff like free RAM and display it.
Implemented probing free low ram (lulz 3 lines of code) but today I didn't make much progress

Here's a gif

Did somebody say FREE RAM!? Download More RAM!



Sorry for not contributing.
Good job my son

Just kidding, currently having some triple faulting issues with my GDT and protected mode so working on that on the moment
hard to understand
Posts 112 of 12 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?