# is celeron in the x86 family?

This topic is 3874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi, I want to make an OS but the only extra comp that I have besides this one (which I don't want to mess up if the bootloader fails or something) is an old celeron machine. I was wondering if I could write assembly code for x86, and use it with a celeron chip. Thnks.

##### Share on other sites
Type "celeron" into google and be enlightened [smile]

##### Share on other sites
If you have to post here to find the answer to that question then I think writing your own OS may be a bit ambitious.

##### Share on other sites
Quote:
 Original post by mattnewportIf you have to post here to find the answer to that question then I think writing your own OS may be a bit ambitious.

lol sorry, yr rite i should have googled first, im just used to getting a straight answer from Game dev, btw writing the OS is totaly ambitious for me :)

##### Share on other sites
Frankly, I wouldn't even bother writing the OS for a real PC. It is so much easier to simply write and test your OS for a virtualized PC first, and then bother with the real hardware once you get it working on the virtual hardware. Far fewer headaches this way.

##### Share on other sites
Quote:
 Original post by MastabaFrankly, I wouldn't even bother writing the OS for a real PC. It is so much easier to simply write and test your OS for a virtualized PC first, and then bother with the real hardware once you get it working on the virtual hardware. Far fewer headaches this way.

Actually I might consider that, so something like Virtual PC 2007 from MS will do fine?

##### Share on other sites
Quote:
Original post by VanillaSnake21
Quote:
 Original post by MastabaFrankly, I wouldn't even bother writing the OS for a real PC. It is so much easier to simply write and test your OS for a virtualized PC first, and then bother with the real hardware once you get it working on the virtual hardware. Far fewer headaches this way.

Actually I might consider that, so something like Virtual PC 2007 from MS will do fine?

It will; however, I'd suggest you look into Bochs. It's an alright emulator -- it's a little slow, but it's also open source (which is genuinely useful; it's the one open source program where I've actually modified the source -- to give more information about the state in the debugging mode, and to give more useful information on panics) and can be compiled as a debugger. In general though, all emulators differ from each other and from real machines. It's a good idea to test on a variety of real systems, in addition to a variety of emulators. Just be prepared to spend days trying to get your code to work in all your test environments.

##### Share on other sites
Quote:
 Original post by VanillaSnake21Hi, I want to make an OS but the only extra comp that I have besides this one (which I don't want to mess up if the bootloader fails or something) is an old celeron machine. I was wondering if I could write assembly code for x86, and use it with a celeron chip. Thnks.

Yep, it's like a handicapped little brother of the x86.

##### Share on other sites
since were on the topic of OS dev i might as well ask the question here instead of starting a new thread..
How can I call a kernel from the bootloader, the strange thing is, theres plenty of tutorials on how to make a boot loader, and how to make kernels but none show how to actually load one from another, any extra tutorial sources are welcome, (I get most of the info from osdever.net). Thanks.

##### Share on other sites
Quote:
 How can I call a kernel from the bootloader, the strange thing is, theres plenty of tutorials on how to make a boot loader, and how to make kernels but none show how to actually load one from another, any extra tutorial sources are welcome, (I get most of the info from osdever.net). Thanks.

you need to add the seg selector as well (Useually 08h). ie:
[BITS 32]; set up stack...; pmode jump to kerneljmp 08h:01000h

execution will continue from there.

##### Share on other sites
Quote:
Original post by Crypter
Quote:
 How can I call a kernel from the bootloader, the strange thing is, theres plenty of tutorials on how to make a boot loader, and how to make kernels but none show how to actually load one from another, any extra tutorial sources are welcome, (I get most of the info from osdever.net). Thanks.

you need to add the seg selector as well (Useually 08h). ie:
[BITS 32]; set up stack...; pmode jump to kerneljmp 08h:01000h

execution will continue from there.

thanks, I actulally found a pretty good source written by xsism that shows how to dovelop a bootloader along with a C kernel.

Just one more question, a bit off topic but - what does it mean when a register is used for this or that, for example eax is an accumulation, ebx as a base pointer, ecx as counter - is that just a convention that was decided upon or are they really suited better to the tasks that they are labeled with, aren't registers just small fast rams next to the processor, so whats the difference which one you use for something?

##### Share on other sites

Quote:
 Just one more question, a bit off topic but - what does it mean when a register is used for this or that, for example eax is an accumulation, ebx as a base pointer, ecx as counter - is that just a convention that was decided upon or are they really suited better to the tasks that they are labeled with, aren't registers just small fast rams next to the processor, so whats the difference which one you use for something?

To say that programming an OS is "ambitious" is quite the understatement. Anyone who doesn't automatically that a Celeron processor sold in commidity PCs is an x86 processor doesn't deserve to either a) live or b) program. Go back to Java where they "create" RAM and have infinite processing power, where there are no such things as registers and "hardware". It just a magical box of Sun bytecode!

Or, before you post again, please, READ. Intel will SHIP you free books on the hows and whys of the x86 architecture FOR FREE. F*ck it, I will ORDER THEM FOR YOU if you give me your address.

You obviously aren't in any place even conceive of starting an OS. Hell, even if you understood x86 assembly language, you still aren't even close to being qualified at writing an OS. If you are lucky, it will boot. Maybe.

Any statement that naive makes me wonder whether you bend over with your pants down if I asked you to. OSes and MMORPGs... everyone just *has* to make one. From the ground up. With absolutely no clue.

##### Share on other sites
Quote:
Original post by Figgles

Quote:
 Just one more question, a bit off topic but - what does it mean when a register is used for this or that, for example eax is an accumulation, ebx as a base pointer, ecx as counter - is that just a convention that was decided upon or are they really suited better to the tasks that they are labeled with, aren't registers just small fast rams next to the processor, so whats the difference which one you use for something?

To say that programming an OS is "ambitious" is quite the understatement. Anyone who doesn't automatically that a Celeron processor sold in commidity PCs is an x86 processor doesn't deserve to either a) live or b) program. Go back to Java where they "create" RAM and have infinite processing power, where there are no such things as registers and "hardware". It just a magical box of Sun bytecode!

Or, before you post again, please, READ. Intel will SHIP you free books on the hows and whys of the x86 architecture FOR FREE. F*ck it, I will ORDER THEM FOR YOU if you give me your address.

You obviously aren't in any place even conceive of starting an OS. Hell, even if you understood x86 assembly language, you still aren't even close to being qualified at writing an OS. If you are lucky, it will boot. Maybe.

Any statement that naive makes me wonder whether you bend over with your pants down if I asked you to. OSes and MMORPGs... everyone just *has* to make one. From the ground up. With absolutely no clue.

Thanks for the feedback :), I appreciate any criticism, anyways I'm trying to make an OS not because I wanna show off my programming skills, but on the contrary, to gain them, in order to cover the gaps that you clearly listed.
Quote:
 OSes and MMORPGs... everyone just *has* to make one. From the ground up. With absolutely no clue.
lol, yea I don't like MMORPG posts either, but for me making an OS is an inspiring task that as you rightfully mentioned I know nothing about, and the Intel architecture books are way over my head both in terms of asm syntax they use as well as in theory. Thanks.

PS. If some is willing to answer my earlier question about regsiter naming, I'd appreciate it, Tim.

##### Share on other sites
Meh. I love making a post on OS dev threads cauze everyone forgets that there are learning OS kits out there.
Like OS161 (used in my OS class) and Nachos. Both provide all the working knowlege of a kernel, devided
into convient assignments where you get to build up the OS.
I will say Nachos kinda sucks, but OS161 is a great learning tool. And since it runs on a fake MIPS machine
you even get to deal with some real assembly, and can see all the code for the drivers and hardware.
That and a book like Operating System Concepts(6th ed) ISBN: 0-471-25060-0 will get you headed in the right direction
without having to learn too much "real world" OS programming issues from the getgo.

----

When you look at something like x86, the registers are used for things because the hardware assumes they are used for that.
(this relates to x86 having lots of specific use instructions that assume registers like the loop counter
are all set up to loop on)
When you look at something like MIPS or SPARC, the registers are used for things because of a convention
you can use them outside that convention if you are careful and/or you are not writing ASM that will ever interface
with other ASM code.
(since the processor has no register specific instructions)

This is the difference between CISC and RISC systems. Being that the CISC systems provide lots of
instructions that do many different things that you may or may not ever use.
The RISC provide a much smaller set of instructions that provide only basic functionality.
As such, on a RISC machine (MIPS/SPARC) you may end up writing 2+ instructions to take the place of 1 CISC
instruction.
(never done x86, but i hear there is a "loop" instuction, on SPARC/MIPS you need to do a SUB, COMP, JUMP to
preform the same functionality)
Each system has benifits and drawbacks, so dont assume more instructions is bad, a RISC machine may appear
to have less diection functionality, but the simplisity means the chip can process each instruction
quicker.

[Edited by - KulSeran on May 8, 2007 9:03:32 PM]

##### Share on other sites
Quote:
 Like OS161 (used in my OS class) and Nachos. Both provide all the working knowlege of a kernel, devided into convient assignments where you get to build up the OS.
I looked it up but it seems to be more suited for a class environment, I think I'll just stick with online tutorials for now just to get some ground in OS dev.

Quote:
 When you look at something like x86, the registers are used for things because the hardware assumes they are used for that.(this relates to x86 having lots of specific use instructions that assume registers like the loop counterare all set up to loop on)

I see what you mean, so you can't put ADD resultant into ESP because that would not be just a number anymore but a memory address where the stack pointer will point to. Thanks =)

##### Share on other sites
Quote:
 Original post by Figgles...

blah.

Go ahead and do it. You'll learn something. I did the same thing. I wrote a little "OS," if you could call it that, which had a bootloader and a simple console driver. I called it "DumbOS." It was completely impractical and totally worthless, but I learned a lot about GCC, make, nasm, AT&T assembly syntax, x86 assembly, BIOS, virtual memory, process priority levels, etc., etc., etc. It was fun.

I remember there was a dated, but interesting text on OS theory called something like "The Operating System Vade Mecum." It was in PDF format and available for free. You should google it.

##### Share on other sites
Quote:
 Original post by FigglesTo say that programming an OS is "ambitious" is quite the understatement. Anyone who doesn't automatically that a Celeron processor sold in commidity PCs is an x86 processor doesn't deserve to either a) live or b) program. Go back to Java where they "create" RAM and have infinite processing power, where there are no such things as registers and "hardware". It just a magical box of Sun bytecode![Some vitriol here...]

In fairness, there are two ways of approaching programming -- one from the viewpoint that it's a branch of maths, and you're dealing with a perfect, pure abstract machine; the other from the viewpoint that it's almost an electrical engineering task, that you're dealing with billions of little switches which have messy bits and undefined behaviour. At one end of the spectrum -- Lisp languages, Haskell; at the other -- C, assembly language.

Each have their benefits and it is worth learning as much as possible about each and knowing when to treat the computer as if it were a Turing machine and when to treat it as if it is were a Porsche. You'll become a better programmer for it -- learning that there are unsolvable problems, learning about different models of computation, etc.

Quote:
 Go ahead and do it. You'll learn something. I did the same thing. I wrote a little "OS," if you could call it that, which had a bootloader and a simple console driver. I called it "DumbOS." It was completely impractical and totally worthless, but I learned a lot about GCC, make, nasm, AT&T assembly syntax, x86 assembly, BIOS, virtual memory, process priority levels, etc., etc., etc. It was fun.

Seconded. It's not like you intend to release this to the general public, or use it to run a life support system -- it's a piece of fun, intended to teach you stuff. I also wrote a little 'O.S.' of sorts. Whilst it was crude, it taught me a great deal about the toolchain, C, and all sorts of operating system design considerations. It helped me improve my skills; but now I'm looking at the more abstract end of that spectrum I mentioned.

##### Share on other sites

This topic is 3874 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Create an account

Register a new account

• ### Forum Statistics

• Total Topics
628715
• Total Posts
2984362

• 24
• 11
• 10
• 13
• 14