memory size probing

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
_mark

Re:memory size probing

Post by _mark »

First of all an OS kernel is hardly a large engineering project. And since when are boot loaders small asm programs? A boot sector usually is, but then again it may not be. Some OS kernels are just small asm programs, but most of the popular desktop ones are not. In fact most bootloaders are in fact small OSs. It is all about perspective Tim.

The point is, it is all just what I call system level programming. If you can read a tech manual enough to write a boot loader, then you can probably do the same for an OS. And if you cannot get through the manuals enough to write a bootloader, how in the world to you expect to get through the manuals to interact with a processor. IT is all in the details Tim.

~peace~
_mark()
pskyboy

Re:memory size probing

Post by pskyboy »

I have to agree with mark here. I think a writing a bootloader is a good way to get into OS programming it forces you to understand the underlying hardware much more then just doing a kernel straight off in C would require. It is also the most challenging part in terms of pure exasperation and effort so gets you in the right mindset for kernel dev.

I also learned asm from writing my bootloader as i tend to learn everything by having a projec to achieve in it.
I know this doesn't work for everyone and im not suggesting everyone do it, but i think to immediately say if you don't know asm don't wirte a bootloader is ridiculous.

Peter
Tim

Re:memory size probing

Post by Tim »

I don't mean to keep replying to this thread as I'd just start repeating myself.

However: the majority of OS projects stop at the boot loader stage. This seems to be because the authors get excited when they start their loader, then get bored/confused, and eventually give up. If you're able to finish your boot loader and write a great OS kernel, then that's brilliant. What I don't want to see is people starting a boot loader, coming up against lots of obstacles, and failing to reach the real OS development part.
_mark

Re:memory size probing

Post by _mark »

Many people will start an OS an not finish it also. I will probably be one. The problem that I suffer from and I would bet many others do, is that once the challenging part is over and the grunt coding starts - it is time to find a new project. You see some of the unfinished things I have scattered around my hard drive. Compilers, Linker, Desktop environments, geophisical analysis tools....the list is endless.

The fact that I have not finished something though is not such a bad thing. I did enough to learn what I wanted and moved onto something else I could learn from.

_mark
Tim

Re:memory size probing

Post by Tim »

A point I touched on earlier is the difference between acquisition of raw knowledge (how to write real-mode assembly code, how to interface to BIOS int 13h, etc.) and the ability to build software systems. Doing the interesting/hard stuff sounds to me like doing the former, whereas designing an OS and/or kernel and actually going out and building it is the latter.

Any computer literate person can sit down with a stack of computer manuals and figure something out. To reach enlightenment, you must also learn how to program -- in the fullest sense -- which is something that's very difficult to teach, and very difficult to learn without a lot of experience.
Curufir

Re:memory size probing

Post by Curufir »

I'd just like to make this small point, which I do every time this topic comes up (And it happens regularily).

Although fundamentally writing your own bootloader is a fairly non-productive use of your time (GRUB and its kindred are more than good enough unless you have very specific requirements) it's an excellent entry point.

Many people don't really start off OS dev with a huge amount of knowledge about OS mechanisms/common algorithms/advanced programming (I know I certainly didn't :)). Writing a bootloader does a few things for you, things that are good whether you keep the bootloader or just get a scratch working model before switching to something else.
  • Research - This is the real crux of OS programming. Sure there is a large amount of programming skill required, sure there's a lot of design work, but you aren't going to get anywhere fast without the ability to research problems in order to find a solution. Bootloaders have a well travelled research path (Unlike some other areas of OS dev) that can break you in slowly to research techniques.
  • Sites of interest - Let's face it, there are very few areas outside of OS dev that are going to force anyone to consider writing a bootloader. Practically all the sites you hit whilst researching your bootloader are going to be OS dev sites, and link to other OS dev sites. Whilst researching the bootloader you are putting together a list of sites that contain information you are going to want later on, and in many cases it will be information solving problems you never knew existed.
  • Speed - There's a common problem with programmers (Myself included). We often see a problem, rush into things and take the first solution that springs to mind. This is an absolute killer to a project. There's nothing worse than programming away for four or five months only to realise that some basic premise was wrong and you have to recode the entire project. OS dev requires design work, you simply cannot start coding without thinking or you'll wind up going nowhere fast. While you're writing your bootloader you aren't writing your memory manager/scheduler/whatever. That doesn't mean you aren't thinking about them though, what it does is give you time, whilst at least having some code to bash at, to plan out your first real moves in the kernel without getting yourself locked into a decision by rushing things.
  • Contacts - Starting with the bootloader is common, very common in fact, I think most of us dove in at some point and had a crack at it. Now looking around the old posts this should become apparent to anyone starting out (Everyone did read the old posts, yes? ;D). It should also be obvious that asking seriously dumb questions about bootloaders is pretty much a standard way of making your presence known on an OS forum. Yup, you'll generate this precise "bootloader Vs no bootloader" argument, but anyone reading the thread immediately thinks "Ahh, newbie, go easy on 'em." (At least I do). It's almost the secret password for informing people you're starting out, which makes it a non-threatening way to get involved on the forum (There are exceptions of course. "I want a splash screen, I want a splash screen now" being another, no names mentioned *cough* Perica *cough* ;D).
All in all I agree with everything Tim has said. The actual programming of the bootloader, the 16 bit coding, the real mode memory problems, interacting with the BIOS are all things you really aren't going to need a whole heck of a lot. My point is that the corollary effects of writing a bootloader are usually worthwhile, and should be considered before using GRUB right off the bat. Reaching your destination is good, but it is in the journey that we learn new things.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:memory size probing

Post by Perica »

..
Last edited by Perica on Thu Nov 30, 2006 10:39 pm, edited 1 time in total.
distantvoices
Member
Member
Posts: 1600
Joined: Wed Oct 18, 2006 11:59 am
Location: Vienna/Austria
Contact:

Re:memory size probing

Post by distantvoices »

*juggling with mixed pickles...*

and no they won't be thrown at you, curufir *ggg*

Of course, it's he learning, why some do bootloader hacking. But when you come to decide p. ex. which file system you want to develop for, and you decide to use ext2 (i want to use it) you are in the situation where you have no chance to stuff file system support in 512 bytes. You have to hack together a second stage bootloader. I didn't want to spend my time for something that keen programmers have already done for me. I am so to say a lazy lizard (thx curufir for inspiration). I spend more time figuring out how to organize linked lists and b-trees for my process handling in a proper way with the proper primitives then to meddle around with boot loaders. It is just a question of preference. as for time:a reasonable good programmer takes the time to think and design his code structures in a proper way.

One point more: even if you code your bootloader to fit into 512 bytes, you still have to debug it, and with debugging you usually spend three quarters of development time *gg*

@perica: if you are the former berserk ... i 've gone throu' that thread. Oy gewalt, i have to admit, you posted many many questions ... and then got your fancy that stubbornly attracted by that splash screen and graphics crap, I don't wonder why curufir lost words about it here. *ggg* He has cumulated all your sentences to two short ones. *gg*
... the osdever formerly known as beyond infinity ...
BlueillusionOS iso image
slacker

Re:memory size probing

Post by slacker »

i see a bootloader as a part of an operating system. does microsoft use grub? then i wont use grub.
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Re:memory size probing

Post by Perica »

..
Last edited by Perica on Fri Dec 01, 2006 8:44 pm, edited 1 time in total.
slacker

Re:memory size probing

Post by slacker »

if OSdeving is about learning(for me) why wouldnt anyone want to persue a bootloader?
Dragonsimoto

Re:memory size probing

Post by Dragonsimoto »

I will agree with Slacker and the others, being a newbie and wanting to program an os.

I want to do everything on my own, no one elses code, only mine. So I feel like _I_ did it, not some great GRUB coders.

As for the thought of using GRUB then making your own Loader...That is ok but then you don't fully appreciate what GRUB does for you.. You don't understand the underlying hardware, IMO.

But i am just a newbie so ignore me.
jamescox3k

Re:memory size probing

Post by jamescox3k »

This is my view on the bootloader front. By all means try to code a good boot loader, one thats better than GRUB or atlaest provides the same exelent functionality. Now here you can fail (I did) or succeed (WOW good for you).

For those who failed, use GRUB, after trying the bootloader thing you will apreciate what it dose. Then go back and finnish your bootloader later (After yo have something GOOD to boot).

As for
i see a bootloader as a part of an operating system. does microsoft use grub? then i wont use grub.
Well if Microsoft dont use it, then it's good enogh for me

By the way SuSE Linux use GRUB and SuSE kicks Windows @$$
Tim

Re:memory size probing

Post by Tim »

SuSE? Give me a break.

This thread is closed unless anyone has anything new to add.
jamescox3k

Re:memory size probing

Post by jamescox3k »

SuSE? Give me a break.
What is ment by this?

If you dont think it's the best distrobution then fine. But Linux is way better than windows. Especialy for OS dev. Thats what your doing here right?
Post Reply