Page 2 of 3

Re: Creating OS [Noobie :D]

Posted: Wed Nov 16, 2011 4:51 pm
by akatchi
death2all wrote:For a bootloader, I dare say that mine is just kludged together, and loads in the kernel from a predefined sector on disk (64, if you must know.) That's all you will really need, I would have thought. I am working on improving my boot loader now, to get it multiboot compliant, and the same with my kernel, but this is not mandatory just to get a basic OS working. As for displaying characters, it is BIOS interrupt 0x10 (I forget the service number, use Ralph Brown's Interrupt List for that...)

As for the whole thing, not too long, depending on how far you want to go, and what you want it to do. In its current state, my OS took about 2 months, most of which was consumed by a paging bug (albeit a really nooby bug, and one that I could very easily have avoided, and any competent programmer would have done.) All in all, to get a single command, in PMode, with paging and a flat memory model, a rough guesstimate gives me around 2-3 months, if you use your time well, and don't make any stupid mistakes.
Is it that easy to create a simple bootloader =o i was like wow it sure gonna take some time to create one but when you say you did it so fast xD. if i only create
an cross-compiler
a (micro etc... dont know wich one yet) kernel
and a bootloader or grubs
i can make an os already =o
wow thats quite fast =) i got till 1 february for my OS and i first wanna start with creating a very basic one and if i got time left then ill upgrade it, but i got a holiday between it :3 and a test week (you only get 1/2 tests a day looks like an exam in our country) wich means i got alot of free time 2 ^^
atm im doing an detailled report about what a os is exactly, just found out alot of things xD also gonna add stuff like the Algol 68 :3 its just im on wikipedia translating everything while im typing and then ill see something new blue's and that is pressable so i press it xD gonna explain that again :3 so its gonna be very detailed xD even if my os is gonna fail that might make my grade a nice one ^^

regards, Akatchi

Re: Creating OS [Noobie :D]

Posted: Thu Nov 17, 2011 5:29 am
by CWood
You're overcomplicating things. You don't need a cross compiler yet. Start small. Normal gcc will work fine, so long as you link as flat binary (check on the wiki for this.) I would also recommend against Algol 68 as well at this stage. After your exam, if you want to carry on with your OS, fine, the world is your oyster. But to start with, especially for your exam, concentrate on getting a very simple command, such as "sysinfo" with the CPU Vendor string, and amount of memory, printed. I'm not saying you're not capable of doing a cross compiler etc, I'm just saying that it does increase the likelihood that it won't work in time for your deadline, which is risky if it is for school. My computing teacher told me that to create a fully fledged OS, it takes 10,000 hours. You don't have that kind of time, unless you are Arnold Schwarzenegger in one of his movies. Go simple. It shouldn't take more than a month to display a simple memory map and vendor ID. Then, if you want, upscale after the deadline, as your own project.

Re: Creating OS [Noobie :D]

Posted: Thu Nov 17, 2011 3:50 pm
by Combuster
You don't need a cross compiler yet. Start small. Normal gcc will work fine
For anyone stuck in the past with 32-bit linux that knows exactly what sort of hack he's pulling off, host gcc can work. In all (other) cases, crosscompiler. It also happens to be one of the easiest steps to make one.

Re: Creating OS [Noobie :D]

Posted: Thu Nov 17, 2011 4:09 pm
by Kazinsal
Combuster wrote:For anyone stuck in the past with 32-bit linux that knows exactly what sort of hack he's pulling off, host gcc can work.
S/he also needs to know that the terrible kind of hack involved not only could cause the OS to not compile/not compile correctly for someone with, say, an i586-elf-gcc crosscompiler, but can also cause issues to arise when compiled with his or her own host compiler.

Imagine: one day, everything's fine, then you add a little feature or bugfix and boom, your OS no longer compiles.

Your default toolset install is designed to build for the specific OS you're running - not another OS and certainly not to build an OS of your own creation.

Re: Creating OS [Noobie :D]

Posted: Thu Nov 17, 2011 5:20 pm
by Brynet-Inc
The system toolchain is not really suitable for anything but the host system, distributions almost always includes local patches not found in the vanilla sources.

It is incredibly simple to create a cross-compiler, so just take the time. Bonus, you're creating a build environment that is reproducible by others.

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 5:31 am
by CWood
Now I'm really gonna ruffle a few feathers. I develop directly in asm, not C. I only use flat binary linking using ld, to make my life easier rather than using the %include rubbish which makes the whole thing a hemorrhoid waiting to happen.

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 6:40 am
by Combuster
death2all wrote:Now I'm really gonna ruffle a few feathers. I develop directly in asm, not C.
Then this is probably a good example why Assembler developers are not that good at giving C-and-OS related advice. :wink:

Take care next time.

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 7:08 am
by CWood
hehe fair enough thanks Combuster

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 2:26 pm
by akatchi
death2all made an OS in assembly ? if its possible id like to create mines for as far as possible :D
is it possible to say what things i need to make becuase i dont understand anythign at all atm :oops: , totally dont know what to make for the very very basic os ^^
thanks for all the responses by the way
:D

Regards Akatchi

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 2:42 pm
by CWood
It is very possible to write entirely in asm. Just be sure to be able to convert from C to asm mentally (not actually that different, given how similar C is to asm...)

edit: difficult

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 3:43 pm
by gerryg400
death2all wrote:It is very possible to write entirely in asm. Just be sure to be able to convert from C to asm mentally (not actually that different, given how similar C is to asm...)

edit: difficult
That's very confusing. If you're writing an OS in asm why do you need to "convert from C to asm mentally" ?

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 4:14 pm
by rdos
death2all wrote:It is very possible to write entirely in asm. Just be sure to be able to convert from C to asm mentally (not actually that different, given how similar C is to asm...)

edit: difficult
No sane person would "convert from C to asm". I write directly in asm because asm is superior to C, and if I do any type of "conversions" they are from C++, not C. When I'm forced to use C, I would still think in C++, and convert C++ OO to C, which is perfectly possible.

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 4:22 pm
by gerryg400
rdos wrote:
death2all wrote:It is very possible to write entirely in asm. Just be sure to be able to convert from C to asm mentally (not actually that different, given how similar C is to asm...)

edit: difficult
No sane person would "convert from C to asm". I write directly in asm because asm is superior to C, and if I do any type of "conversions" they are from C++, not C. When I'm forced to use C, I would still think in C++, and convert C++ OO to C, which is perfectly possible.
So, rdos, you are an asm fan, and prefer asm to C ?

Why didn't you say so before ? :)

Re: Creating OS [Noobie :D]

Posted: Fri Nov 18, 2011 4:51 pm
by Combuster
Mentally needing to translate between language constructs implies you haven't mastered the language at all, because each language has it's own way of solving typical problems.

Try implementing an advanced data structure in C, C++ and Objective C with maintainability being your first concern. If your approach to memory management is not different in all three versions you did something wrong.

Re: Creating OS [Noobie :D]

Posted: Sat Nov 19, 2011 6:22 am
by CWood
What I meant was, most resources out there are written in C. I did not mean anything people are suggesting, about not having mastered the language etc, I meant that most code on the wiki, and other resources, is in C, and therefore must be mentally converted to be useful :). IOW, you need to be able to read and understand C to code an OS in ASM.