Porting Newlib

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.
User avatar
inflater
Member
Member
Posts: 1309
Joined: Thu Sep 28, 2006 10:32 am
Location: Slovakia
Contact:

Post by inflater »

pcmattman wrote:OK, I'm getting to that stage where I'm almost ready for release of the newest version of my OS
Hehe, I will sure look at it :) Could you post single screenshot of your OS? I'd like to see what your OS can do :) [well only porting newlib to Mattise is re$pect 8)]

And what should I do, a Pascal/mediocre ASM programmer? :D I am slowly having self-hosting in my OS [former Pascal, 32bitASM now for those who doesnt know] but I need to release some documentation,... How? The system interrupts descriptions in PDF (or html) will be enough?

Regards
inflater
My web site: http://inflater.wz.cz (Slovak)
Derrick operating system: http://derrick.xf.cz (Slovak and English :P)
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

JamesM wrote:Note that printf() is a highly, HIGHLY monolithic and complex function. It uses fopen/fwrite etc (buffered i/o) so it requires the syscall "sbrk" to be implemented first and to work correctly. Also it requires the file descriptors stdin/out/err to already be initialised to descriptor values 0/1/2 etc.

Probably worth getting fopen/fwrite to work first, or sprintf into a string and call your syscall write() direct first.

Common stumbling point with newlib - make sure **environ is defined - NULL will do but make sure it's actually there somewhere - you won't get any linker errors if it's not but the library will fall over.

JamesM
Thanks for the help.

I didn't realize stdin/out/err had to be set, though my sbrk implementation should work properly.

I do have environ defined (as per the syscalls section of libc.info)...

I think my real problem is my ELF loader, which probably doesn't load .rodata :D
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

inflater wrote:
pcmattman wrote:OK, I'm getting to that stage where I'm almost ready for release of the newest version of my OS
Hehe, I will sure look at it :) Could you post single screenshot of your OS? I'd like to see what your OS can do :) [well only porting newlib to Mattise is re$pect 8)]

And what should I do, a Pascal/mediocre ASM programmer? :D I am slowly having self-hosting in my OS [former Pascal, 32bitASM now for those who doesnt know] but I need to release some documentation,... How? The system interrupts descriptions in PDF (or html) will be enough?

Regards
inflater
No screen shots yet, I'm keeping it under wraps until I'm ready :D. And really it's not a lot now, I'm just making sure everything is ready. It's a microkernel so all the drivers are in their own address spaces - which makes my life difficult at times. Thankfully it's currently only in one big address space (but I'm about to start implementing paging).

Pascal/ASM programmers:

You'll want programmers to write programs for your OS in C, so port newlib or something like that. All you need is the 17 syscalls that they require you to use as glue. PM me if you want more.
pcmattman
Member
Member
Posts: 2566
Joined: Sun Jan 14, 2007 9:15 pm
Libera.chat IRC: miselin
Location: Sydney, Australia (I come from a land down under!)
Contact:

Post by pcmattman »

OK, a tutorial for porting newlib is up on the wiki: Porting_Newlib

Thanks for all your help guys :D
Post Reply