...

View Full Version : Writing a Boot loader



Troncoso
02-06-2011, 04:51 PM
I couldn't find an intro thread so I figured I'd just go ahead and make a thread on my topic and at the same time introduce myself. I'm Troncoso! I'm currently in college with the intentions of a computer science degree. Something I haven't learned to much about is the whole machine code to low level language deal. I'd like to write my own bootloader in assembly, but first I have some questions:

Besides learning the assembly language, what do I need to learn (hardware or software wise) to competently tackle this project?

What software can I use to write/compile/write to a disk in Windows 7?

Once I've completed the bootloader, what do I need to do to boot different partitions? Or what is that process?

Thanks for any help. I've looked at several threads throughout the internet of people who want to try this sort of thing and a lot of people will just sit there and say "you need to learn how to program first" "you need to start with smaller projects". I know this stuff. I don't plan on using the answers to these questions and jumping into the fray of it all. I want to learn all I can about this and I figure the best way to learn is to tackle a project that presents different challenges that I need to learn in order to continue to the final result. So, Again, thanks for any help!

oracleguy
02-06-2011, 09:30 PM
Well if you want to see how to write one, you can look at the source code of the very popular open source bootloader, GRUB (http://www.gnu.org/software/grub/).

Troncoso
02-07-2011, 12:20 AM
Thank you for that but it's not exactly what I'm looking for. I would use that when actually writing my own but what I'd like to know doesn't deal with the actual coding.

oesxyl
02-07-2011, 01:17 AM
Thank you for that but it's not exactly what I'm looking for. I would use that when actually writing my own but what I'd like to know doesn't deal with the actual coding.
how did you know that is not exactly what you are looking for since you have no idea from where to start?

best regards

Troncoso
02-07-2011, 01:24 AM
I never said I had no idea where to start. I know I need to know assembly. And I've even done some simple loaders for practice. What I'm looking for are the answers to the questions I asked.

oracleguy
02-07-2011, 04:32 AM
I never said I had no idea where to start. I know I need to know assembly. And I've even done some simple loaders for practice. What I'm looking for are the answers to the questions I asked.

Well ok then.


Besides learning the assembly language, what do I need to learn (hardware or software wise) to competently tackle this project?

You'll also need to know how to program in C.

And you'll need to understand how the architecture is designed when it is powered on. I am guessing you want to do this on x86 so you'll want to do some research on how it works when it is first powered on. I don't know how much information there is on the net about, you might find better resources in books though.



What software can I use to write/compile/write to a disk in Windows 7?

Can you clarify what you mean, like what are you trying to do? You can write files to the hd from pretty much any lanauge.

EZcode
02-07-2011, 09:00 AM
I couldn't find an intro thread so I figured I'd just go ahead and make a thread on my topic and at the same time introduce myself. I'm Troncoso! I'm currently in college with the intentions of a computer science degree. Something I haven't learned to much about is the whole machine code to low level language deal. I'd like to write my own bootloader in assembly, but first I have some questions:

Besides learning the assembly language, what do I need to learn (hardware or software wise) to competently tackle this project?

What software can I use to write/compile/write to a disk in Windows 7?

Once I've completed the bootloader, what do I need to do to boot different partitions? Or what is that process?

Thanks for any help. I've looked at several threads throughout the internet of people who want to try this sort of thing and a lot of people will just sit there and say "you need to learn how to program first" "you need to start with smaller projects". I know this stuff. I don't plan on using the answers to these questions and jumping into the fray of it all. I want to learn all I can about this and I figure the best way to learn is to tackle a project that presents different challenges that I need to learn in order to continue to the final result. So, Again, thanks for any help!


The project is kind of advance if you do not know much about programming, but if you get a book on C, which I'm sure they recommend in your classes, you will start to learn how to the language to do write to the disk, load programs etc. All that you want to do comes with learning the language and using library from others, or building your own.

Troncoso
02-07-2011, 12:34 PM
Well ok then.



You'll also need to know how to program in C.

And you'll need to understand how the architecture is designed when it is powered on. I am guessing you want to do this on x86 so you'll want to do some research on how it works when it is first powered on. I don't know how much information there is on the net about, you might find better resources in books though.



Can you clarify what you mean, like what are you trying to do? You can write files to the hd from pretty much any lanauge.

What I mean by the last question is, how can I compile and run/emulate the bootloader in windows 7. I'm tired of writing it to a disk and restarting my pc to test it out.

And I have experience in programming, but its all high level language stuff, ie. Python, vb.net, c++, etc.

Once I get better at assembly I don't feel this will be too hard to do.

oracleguy
02-07-2011, 03:59 PM
What I mean by the last question is, how can I compile and run/emulate the bootloader in windows 7. I'm tired of writing it to a disk and restarting my pc to test it out.

And I have experience in programming, but its all high level language stuff, ie. Python, vb.net, c++, etc.

Once I get better at assembly I don't feel this will be too hard to do.
Use a virtual machine instead, then you don't need to reboot, you can just load your code into the VM and try booting that.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum