porting BASH, GCC, and glibc

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
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

The OSDev wiki wrote:Error: junk at end of line, first unrecognized character is ','

This, in combination with lots of other assembly-level error messages (like, Warning: .type pseudo-op used outside of .def/.endef ignored, or Error: unknown pseudo-op: '.local') results when you did not correctly set the --prefix=$PREFIX during the binutils configure.
I suggest you run through the GCC Cross-Compiler tutorial again
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
JamesM
Member
Member
Posts: 2935
Joined: Tue Jul 10, 2007 5:27 am
Location: York, United Kingdom
Contact:

Post by JamesM »

What the hell?! can everyone except me see these attachments?!
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

If you're logged in, you should be able to see them. Otherwise, check your permissions (bottom right) and contact the admin.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
AndrewAPrice
Member
Member
Posts: 2309
Joined: Mon Jun 05, 2006 11:00 pm
Location: USA (and Australia)

Post by AndrewAPrice »

GLneo wrote:well, now I'm having trouble compiling newlib, does any one have a precompiled binary that i could just link with my OS's "gluecode"?

thx!
I do.. but unless you want to implement the exact same underlying system as me (in terms of event management, exactly the same system calls), my precompiled library would be of no use.

EDIT: It's really not that hard to port. I assume your OS has console functions? Well, you can start out by creating a blank system configuration (see Getting Ready on the Porting Newlib wiki page). The modify write(). If file==cout then have a system call for outputting a set-length string to the screen. Simple! Then work through each system call one by one and implement them.
My OS is Perception.
Smilediver
Member
Member
Posts: 37
Joined: Sun Aug 05, 2007 4:23 pm

Post by Smilediver »

You can try to search this forum for "newlib" or "newlib port". There are posts with someone's patches for binutils, gcc and newlib. You can take those and start from there. I did, and at least it gave me a direction where to move. It took me like 2-3 weeks to build it. It actually took me less, but I wanted to build it as shared lib, so it gave me more troubles.

Anyway, this weekend i finally did managed to port the bash with some hacks and linking to my brand new newlib. I've added linux like syscall interface to my OS, and made newlib call the dummy handlers for them. I also added a "not implemented" syscall, and put into all functions in newlib, that I needed to add for bash to compile. All I can say, is that first calls that bash makes are "open" and "close" to check for "/dev/tty". Unfortunately later bash segfaults when it calls _malloc_r... :-) Probably due to uninitialized library.

Good luck with porting newlib. With some persistence you can do it. :-)
Post Reply