Thread: OS development

Results 1 to 12 of 12
  1. #1
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused

    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
    Last edited by ɑrtemis; 02-10-2013 at 02:03 PM.

  2. The Following 2 Users Say Thank You to ɑrtemis For This Useful Post:

    abuckau907 (02-10-2013),Void (02-10-2013)

  3. #2
    Void's Avatar
    Join Date
    Sep 2009
    Gender
    male
    Location
    Inline.
    Posts
    3,198
    Reputation
    205
    Thanks
    1,445
    My Mood
    Mellow
    Make your own bootloader, it's not that hard.

  4. #3
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused
    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.

  5. #4
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. #5
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused
    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

  7. #6
    radnomguywfq3's Avatar
    Join Date
    Jan 2007
    Gender
    male
    Location
    J:\E\T\A\M\A\Y.exe
    Posts
    8,858
    Reputation
    381
    Thanks
    1,823
    My Mood
    Sad
    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.
    Last edited by radnomguywfq3; 02-12-2013 at 02:49 AM.



    There are two types of tragedies in life. One is not getting what you want, the other is getting it.

    If you wake up at a different time in a different place, could you wake up as a different person?


  8. #7
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused
    Quote Originally Posted by Jetamay 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
    Last edited by ɑrtemis; 02-12-2013 at 06:58 AM.

  9. #8
    ɑrtemis's Avatar
    Join Date
    Aug 2010
    Gender
    male
    Location
    arun's urethra
    Posts
    260
    Reputation
    24
    Thanks
    17
    My Mood
    Amused
    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

  10. #9
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    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 Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  11. The Following User Says Thank You to Jason For This Useful Post:

    ɑrtemis (02-12-2013)

  12. #10
    Auxilium's Avatar
    Join Date
    Jul 2010
    Gender
    male
    Location
    深い碧の果てに
    Posts
    4,518
    Reputation
    445
    Thanks
    609
    My Mood
    Happy
    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

  13. #11
    Bat-Man's Avatar
    Join Date
    Feb 2013
    Gender
    male
    Location
    London
    Posts
    256
    Reputation
    10
    Thanks
    6
    My Mood
    Fine
    hard to understand

  14. #12
    jvwarrior's Avatar
    Join Date
    Oct 2008
    Gender
    male
    Posts
    14
    Reputation
    10
    Thanks
    4
    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.

Similar Threads

  1. Direct-X Tutorials (Game Development)
    By Dave84311 in forum C++/C Programming
    Replies: 12
    Last Post: 02-27-2009, 11:15 AM
  2. Driver Development Kit/ Plz
    By Stefanlg14 in forum WarRock - International Hacks
    Replies: 1
    Last Post: 04-16-2007, 09:57 AM
  3. Developer's Mode // GPS for those who requested it.
    By KenCat in forum WarRock - International Hacks
    Replies: 22
    Last Post: 04-11-2007, 08:50 PM
  4. Replies: 2
    Last Post: 03-01-2007, 07:10 PM