Creating Personal Operating System.

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

55 Replies - 5258 Views - Last Post: 25 July 2011 - 08:37 PM Rate Topic: -----

#1 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Creating Personal Operating System.

Posted 14 June 2011 - 02:02 PM

I'm in the process of writing my own operating system.

I'm going to use C++ and assembly to create the system. I can write my own libraries for the cout, cin, minimal functions, etc.

Currently I'm at the boot stage in the design of the OS.

Quick question:

I only plan on writing the boot program so that it will ONLY load the true OS into the 0x7... memory address. That is it. I'm not going to include all of the fancy boot options, BIOS modify screen, or network boot options.

Because of this I just want to know what is usually included when a boot program is made because I will not follow standards, there's just too many of them. (They were right when they said the OS is the top of the line to programming!)

What do most boot programs include in their start-up process besides loading the OS into the memory for its first stage? Do I really needs to motherboard's BIOS? Can't I somehow rewrite it with my boot code?

Things such as:
1.) computer powers on
2.) BIOS program runs on first level
3.) BIOS allocates and loads OS to memory
4.) BIOS runs, theoretically, never ending "while()" loop for OS.
5.) OS programs runs, loads kernel, displays GUI, pictures, and then finally goes to the login screen.


Stuff like that will help. I only want to know what boot programs usually do on boot, since I will not include all the bells and whistles.

I've been all over the net looking for tips that will inform me of some of the standard things boot programs do: http://wiki.osdev.org/Main_Page

I have been getting information so far, but only a real person can know what I mean by "standard process".

Thanks,

Sorry, not going to give the boot file a showing until I have the basic loader down...

P.S. keep in touch. I will make a playlist of my progress on my site: http://www.valevarka...m/Projects.php.

P.S.S.: I'm not sure how long it will take to do the boot program because I will be stripping the boot of a lot of normal processes.

P.S.S.S.: Please, criticize. It doesn't make you look bad. You're just trying to warn of the problems associated with my project!

Attached image(s)

  • Attached Image

This post has been edited by macb6497: 14 June 2011 - 02:03 PM


Is This A Good Question/Topic? 0
  • +

Replies To: Creating Personal Operating System.

#2 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 02:30 PM

Ok, did a little more search. Who knows what you can find by doing a little careless typing. :)

When I said I was going to skip the BIOS configuration menus and other stuff accessible only during start-up, I meant I was going to completely exclude that because I can always edit most of the stuff from inside the OS program itself and then restart the computer.

* The memory-resident code
o Runs self-test.
o Probes bus for the boot device
o Reads the boot program from the boot device.
* Boot program reads in the kernel and passes control to it.
* Kernel identifies and configures the devices.
* Initializes the system and starts the system processes.
* Brings up the system in single-user mode (if necessary).
* Runs the appropriate startup scripts.
* Brings up the system for multi-user operation.


"During the first stage, a small boot program is read into memory from a default or specified device."


Looking good so far. I'm in the right direction. I'm guessing I can modify the current BIOS of my test computer.


"The last step in bootstrapping the kernel starts the /etc/init process. The init process runs as process 1 and always remains in the background when the system is running"

That was the infinite "while()" statement I was talking about in my first post.

If I'm going to get rid of the BIOS, CMOS or EEPROM is where the program is stored"?", currently on my motherboard then I have to do it perfect or I don't think I will be able to use the computer pass the power on button. :)


Credit: http://www.bga.org/~...ot-process.html

This post has been edited by macb6497: 14 June 2011 - 02:42 PM

Was This Post Helpful? 0
  • +
  • -

#3 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 03:13 PM

Ok, now in order to replace the test computer's BIOS/CMOS/EEPROM/PROM with my asm code all I need to do is to get a similar chip, "burn" it, and "heat gun" it in its place on the motherboard.

The boot code will ONLY load the main program/OS from the MBR that will then take control.

This post has been edited by macb6497: 14 June 2011 - 03:16 PM

Was This Post Helpful? 0
  • +
  • -

#4 RetardedGenius  Icon User is offline

  • >>──(Knee)──►
  • member icon

Reputation: 127
  • View blog
  • Posts: 555
  • Joined: 30-October 10

Re: Creating Personal Operating System.

Posted 14 June 2011 - 03:34 PM

Good luck! :whistling:
Was This Post Helpful? 1
  • +
  • -

#5 jimblumberg  Icon User is offline

  • member icon

Reputation: 5465
  • View blog
  • Posts: 17,015
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 03:41 PM

Are you trying to create a replacement BIOS or an operating system? I would recommend that you let the BIOS do it's "magic" and install your own boot loader to load your operating system. Without knowing the exact hardware writing a BIOS to test and configure your mother board hardware will be very difficult, if not impossible.

Jim
Was This Post Helpful? 3
  • +
  • -

#6 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 04:28 PM

View Postjimblumberg, on 14 June 2011 - 04:41 PM, said:

Are you trying to create a replacement BIOS or an operating system?

Jim



I was trying to create an entirely new "BIOS" that would only load my OS. The only function in the CMOS/PROM/ROM would be to allocate memory to my OS and then transfer control to the OS program.

I don't think I need all the extra functions such as a BIOS password, clock, cpu temperature, boot order, etc. That should sky rocket the level of security, but this could also prove devastating to me in the future for some reason.

I attached a couple of pictures that should some of the microcontrollers I have in stock. Not sure if I can use any right now though.


I also uploaded a video to my site, but the video server is acting retarded: http://www.valevarka...eo&projecting=9

Attached image(s)

  • Attached Image
  • Attached Image
  • Attached Image
  • Attached Image

This post has been edited by macb6497: 14 June 2011 - 04:30 PM

Was This Post Helpful? 0
  • +
  • -

#7 Xupicor  Icon User is offline

  • Nasal Demon
  • member icon

Reputation: 457
  • View blog
  • Posts: 1,179
  • Joined: 31-May 11

Re: Creating Personal Operating System.

Posted 14 June 2011 - 04:36 PM

Nice going, I hope you'll make it. ;) Can I ask you, though, why exactly do you want to write your own BIOS, or an inflexible version of thereof? I know you want it to load your OS, but I can't really understand why you won't leave BIOS as it is, and just focus on the bootloader and OS itself.

Note that I'm not really saying that you shouldn't, actually, I think if it's fun for you, then why not? It's just, if I were in your shoes, I probably wouldn't try it. Not even because I'm not particularly interested in such low level programming, but also, because there's no real need to do it, right? Or am I wrong? :)
Was This Post Helpful? 0
  • +
  • -

#8 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 05:00 PM

View PostXupicor, on 14 June 2011 - 05:36 PM, said:

Nice going, I hope you'll make it. ;) Can I ask you, though, why exactly do you want to write your own BIOS, or an inflexible version of thereof? I know you want it to load your OS, but I can't really understand why you won't leave BIOS as it is, and just focus on the bootloader and OS itself.

Note that I'm not really saying that you shouldn't, actually, I think if it's fun for you, then why not? It's just, if I were in your shoes, I probably wouldn't try it. Not even because I'm not particularly interested in such low level programming, but also, because there's no real need to do it, right? Or am I wrong? :)



Actually, you make good sense and are correct.

The hardware configuration code I more than likely will keep. I might just remove some of the code I don't need from the BIOS program.

I want to create my own BIOS because I don't need any functioning of the peripherals during the start-up. All I need is for the OS to load into the memory and gain control. That's it. I don't want all the extra code in the ROM if I'm not going to use it.

But, the BIOS is really the boot-loader itself. I don't need the keyboard, mouse, etc to function during this process; I might be able to use some of the pre-written code so that I don't have to study different brands of mice, keyboards, and monitors, and the OS will populate the screen and configure the USB bus using that code if I can get it and use it properly. That plug-and-play code would be very handy later down the road. :)


Remember, the bios needs all of its code and kernels so that the keyboard and mouse can be activated in order to select boot options, see posts screens, go into the BIOS, etc. I don't need that, only the OS loading into the memory.

This post has been edited by macb6497: 14 June 2011 - 05:12 PM

Was This Post Helpful? 0
  • +
  • -

#9 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 05:26 PM

You can keep yourself updated here: http://www.valevarka...&projecting=os_


I might not post all of my updates to this thread.
Was This Post Helpful? 0
  • +
  • -

#10 jimblumberg  Icon User is offline

  • member icon

Reputation: 5465
  • View blog
  • Posts: 17,015
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 05:35 PM

If you don't need all of the PC hardware you may want to consider something like a single board computer instead of the PC mother board. The documentation for these SBCs is usually much better than an off the shelf PC motherboard. Here is one such SBC from Advantech.

Note: I am not recommending this particular board but it is an example of a SBC.

Edit: Also the support from the board manufacturer is usually available with a SBC.

Jim

This post has been edited by jimblumberg: 14 June 2011 - 05:37 PM

Was This Post Helpful? 0
  • +
  • -

#11 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 05:45 PM

View Postjimblumberg, on 14 June 2011 - 06:35 PM, said:

If you don't need all of the PC hardware you may want to consider something like a single board computer instead of the PC mother board.

Jim



I just downloaded the BIOS code from the Gigabyte website. I can look at that and see what I want to keep. More than likely the hardware code will stay, but all of the other boot options will be exchanged for simply loading the OS to the memory.


Which I thought was source code, but turned out not to be...

This post has been edited by macb6497: 14 June 2011 - 05:49 PM

Was This Post Helpful? 0
  • +
  • -

#12 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 14 June 2011 - 06:08 PM

For now I'm just going to work on the .asm file that will load the OS into the memory and see how that will work and put my effort into that.

I can always do the BIOS part last and that will only affect what options are available during boot. :)
Was This Post Helpful? 0
  • +
  • -

#13 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 15 June 2011 - 05:18 PM

Ok, so I have decided that my boot will be second stage.

The bin/boot file will load a small program into the memory and then transfer control using jmp ( location );

This extremely small file, say around 150 bytes, will call another script.

To get a perspective of what I'm going to do:

1.) I have a program initiated.
2.) This first program "includes" another source file and initiates functions from that other program.

So far, it doesn't LOOK too difficult. I am not speaking on behalf of all the other OS programmers out there that make good code for public use. This is personal and I only need ONE thing from the boot loader, a small program. I don't know what others go through when it comes to programming, but for me, I do not see too much stress for my first program.

As far as I'm concerned for MY PROJECT, it seems simple at this moment.

The attached picture was taken by me. :)

You can tell by the distinctive dot on the left side of the picture that is in nearly all of my other pictures on my site.

Pretty good, eh!?

Attached image(s)

  • Attached Image

This post has been edited by macb6497: 15 June 2011 - 05:19 PM

Was This Post Helpful? 0
  • +
  • -

#14 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 15 June 2011 - 05:52 PM

The is pretty much what I have so far...

Not much to do, but I want to make sure that I'm not only doing something that works, but is also usable by earlier versions of computers.

as you can see the loader starts with 16 bits and starts with the 0X7C memory location.

The preos calls the os.

the preos is what will be loaded by the bootloader.

See what I mean by its small size.

There should be a "$" in the parenthesis of the "jmp".

I'm also using the standard "TIMES 510 - ($ - $$) db 0" because the first stage is so small.

Attached image(s)

  • Attached Image
  • Attached Image
  • Attached Image

This post has been edited by macb6497: 15 June 2011 - 06:03 PM

Was This Post Helpful? 0
  • +
  • -

#15 macb6497  Icon User is offline

  • D.I.C Head

Reputation: -6
  • View blog
  • Posts: 80
  • Joined: 25-December 09

Re: Creating Personal Operating System.

Posted 15 June 2011 - 06:47 PM

also seems like I will be using Long Mode without going to Protected Mode...

[BITS 64]
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »