OK i do not want to involve the GNU libc into this, and looking at sourcefiles from linux and other kernels is difficult b/c they open several other header files, which in turn does the same. its too messy.
I am looking for a printing mechanism to the screen that understands \n , color, scrolling, etc. is there any independent function anywhere?
Shawn
kernel print function
Re: kernel print function
do you want us to write your os for you? You will have to write some of your own code at some point in time....
a text screen driver is pretty basic stuff.
a text screen driver is pretty basic stuff.
-- Stu --
Re: kernel print function
stripped-down printf():
http://www.execpc.com/~geezer/osd/code/inc/_printf.h
http://www.execpc.com/~geezer/osd/code/ ... doprintf.c
simple putch():
http://www.execpc.com/~geezer/osd/code/osd2.c
putch() with ANSI-like escapes and virtual consoles:
http://www.execpc.com/~geezer/osd/code/osd3.c
http://www.execpc.com/~geezer/os/index.htm#cosmos
http://www.execpc.com/~geezer/os/cons.c
http://www.execpc.com/~geezer/osd/code/inc/_printf.h
http://www.execpc.com/~geezer/osd/code/ ... doprintf.c
simple putch():
http://www.execpc.com/~geezer/osd/code/osd2.c
putch() with ANSI-like escapes and virtual consoles:
http://www.execpc.com/~geezer/osd/code/osd3.c
http://www.execpc.com/~geezer/os/index.htm#cosmos
http://www.execpc.com/~geezer/os/cons.c
Re: kernel print function
stripped-down printf():
http://www.execpc.com/~geezer/osd/code/inc/_printf.h
http://www.execpc.com/~geezer/osd/code/ ... doprintf.c
simple putch():
http://www.execpc.com/~geezer/osd/code/osd2.c
putch() with ANSI-like escapes and virtual consoles:
http://www.execpc.com/~geezer/osd/code/osd3.c
http://www.execpc.com/~geezer/os/index.htm#cosmos
http://www.execpc.com/~geezer/os/cons.c
http://www.execpc.com/~geezer/osd/code/inc/_printf.h
http://www.execpc.com/~geezer/osd/code/ ... doprintf.c
simple putch():
http://www.execpc.com/~geezer/osd/code/osd2.c
putch() with ANSI-like escapes and virtual consoles:
http://www.execpc.com/~geezer/osd/code/osd3.c
http://www.execpc.com/~geezer/os/index.htm#cosmos
http://www.execpc.com/~geezer/os/cons.c
Re: kernel print function
I agree with DF here (though maybe not with his tone), you should be looking for GOOD sample code to emulate, not code you can just copy and paste into your OS. ?Now maybe when it comes time to get an assembler or compiler working, you'd just want to grab GCC and port it, but something like a text driver should be written yourself. ?The more you write, the more you understand. ?
Here's a tip for linux code-browsing, if you go here:
http://lxr.linux.no
You can browse through the linux kernel easily. ?The key here is the version number at the top of the page, click on 1.0.9 (I think). ?Things are MUCH simpler (as in original written by Linus himself 1991 386 code). ?It's kind of fun to look at, he had segment descriptors with 8MB limits (probably b/c that's how much RAM he had and he hadn't implemented demand paging/virtual memory, etc...) ?
Yeah it'll still be confusing (esp the AT&T assembler syntax) but it can be an enlightening experience.
HTH,
Breckin
Here's a tip for linux code-browsing, if you go here:
http://lxr.linux.no
You can browse through the linux kernel easily. ?The key here is the version number at the top of the page, click on 1.0.9 (I think). ?Things are MUCH simpler (as in original written by Linus himself 1991 386 code). ?It's kind of fun to look at, he had segment descriptors with 8MB limits (probably b/c that's how much RAM he had and he hadn't implemented demand paging/virtual memory, etc...) ?
Yeah it'll still be confusing (esp the AT&T assembler syntax) but it can be an enlightening experience.
HTH,
Breckin
Re:kernel print function
Can check out my OS's code... IT has a stdIO.h /stdIO.cpp files which is exactly what you need.... It is independent.....
http://magneto.easyhost4all.info
http://magneto.easyhost4all.info
Re:kernel print function
This thread is 4 years old, if a thread is older than a few months and does not raise any particularly interesting design questions then there is no point resurfacing it - this is just a basic "how do I ..." thread.