Page 1 of 1

look for a simple bootable os!

Posted: Wed Feb 04, 2004 9:28 pm
by fujoey
I am looking for a simple os to study.
It should be bootable with BIOS's INT19, and it is not dependent on the bootloader(such as grub). Maybe I should say that it must contain a simple boot loader. I want to study all the code, but don't want to study grub.
It should be written in C language except the boot part. So I can add my code in C.
It should have printf-like output function. I have written one simple os, but failed to write the printf.
Can you give me some hints about this kind of os.
Thank you in advance.

Re:look for a simple bootable os!

Posted: Thu Feb 05, 2004 1:03 am
by BI lazy
Repeat, *what* do you want?

we could give you Source Code, but then again ... (shakes head) ... study linux or do yourself a treat and get Tanenbaum: OS Design and Implementation.

Printf code 's been one of the *first* things I've done. I've taken time to do some research, looked at other source code for *how* this can be done and then set off with a piece of paper and scribbled some sketch of program flow for a printf with quite some features (and it is still growing...)

A pen and a piece of paper are the developers first choice to bring some order into /dev/brain

Re:look for a simple bootable os!

Posted: Thu Feb 05, 2004 2:09 am
by Pype.Clicker
you may also find the "Simple OS" section of the FAQ interresting ... i guess i found geekos, linux 0.01 and friends overthere, but i must admit i didn't give them a "make" or a boot for there are long time i do not need such stuff anymore ...

**grin** you're so lucky, you don't even have to STFW: i had that page open in my browser already ;)

http://www.osdev.org/osfaq2/index.php/S ... h%20source

Re:look for a simple bootable os!

Posted: Thu Feb 05, 2004 10:43 am
by Pype.Clicker
if printf gives you headaches, i suggest you read documentation about stdarg first (used for ... arguments of printf) the rest should be obvious once you know how to implement itoa ...

hint: try to have a working printf in a user program of another OS before you try to put it in your OS: the debugging will be easier ...

Re:look for a simple bootable os!

Posted: Fri Feb 06, 2004 12:18 am
by Schol-R-LEA
It always astonishes me that people try to write printf() directly. The sensible solution is to write a working putchar() first, then puts(), itoa(), vsprintf(), vprintf(), and then finally printf().

Actually, for within the kernel, I'd write a kputs() and itoa() and drop the issue of a kernel printf() entirely. There is little if any reason for formatted console printing at the kernel level, and the simpler routine eliminates a lot of complexity and programmer overhead. Remember, the kernel printf() is not the same as the version used by the application software library; implementing it in the kernel is a luxury, not a necessity.

Re:look for a simple bootable os!

Posted: Fri Feb 06, 2004 2:04 am
by fujoey
The "exective" may be more suitable for what I want. I am studying the BIOS now. I want to use a small exective to read the tables and codes those BIOS prepare for os.
I write one that work in real mode. It is not convenient with real mode. I also do not know how to handle the stack. I failed to output the string in stack. This statment "kPrintf(str1)" in function k_main of kernel.c dose not work.
I use masm6.11 and bc 3.1. Can somebody tell me the reason. Thank you in advance?

Now I plan to work with the osd9(http://www.execpc.com/~geezer/osd/code). But I find that the osd9's kernel file is dependent on GRUB. Hoiw can I revise it that it can boot from int 19h.

[attachment deleted by admin]