Ach du leiber - bash actually works!
Ach du leiber - bash actually works!
Sorry for the random topic but I'm so utterly uber-chuffed I felt I had to shout it to the world: I just successfully ported bash 3.2
Apart from hax0ring the config.h file because autoconf is a pile of sheep poo when cross-compiling, and adding in a few thousand stub "errno=EBUSY;return -1" functions, there wasn't much I had to do!
Screeny attached
BTW: a big thankyou to all the team at GNU bash for making their program so portable. I tried bash 2.0 and that was an absolute NIGHTMARE to port, so ty ty!
PS: kernel panic is due to my waitpid () function not working when execve fails. (and I haven't wrapped up execve in nice libc wrappers yet).
JamesM
Apart from hax0ring the config.h file because autoconf is a pile of sheep poo when cross-compiling, and adding in a few thousand stub "errno=EBUSY;return -1" functions, there wasn't much I had to do!
Screeny attached
BTW: a big thankyou to all the team at GNU bash for making their program so portable. I tried bash 2.0 and that was an absolute NIGHTMARE to port, so ty ty!
PS: kernel panic is due to my waitpid () function not working when execve fails. (and I haven't wrapped up execve in nice libc wrappers yet).
JamesM
- Attachments
-
- snapshot13.png (25.22 KiB) Viewed 4185 times
-
- Member
- Posts: 37
- Joined: Sun Aug 05, 2007 4:23 pm
-
- 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:
Re: Ach du leiber - bash actually works!
Well doneJamesM wrote:Sorry for the random topic but I'm so utterly uber-chuffed I felt I had to shout it to the world: I just successfully ported bash 3.2
Once I get my file i/o stuff figured out and my message passing works well enough, I'll be writing my execve implementation and then I'll port bash (and GCC, and binutils, and lots of other *nix tools).
Tell us when you get there without panics - it'd be nice to see a fully functional bash port working in a hobby OS.PS: kernel panic is due to my waitpid () function not working when execve fails. (and I haven't wrapped up execve in nice libc wrappers yet).
Heh, I made some changes to my libc and tried to recompile bash yesterday -- only to find that my doctored config.h had been overwritten. So now I can't remember what flags I had set, and bash keeps trying to compile in stuff which requires dirent.h -- which I haven't ported yet! D'oh! I'll have to port that tonight
-
- Member
- Posts: 37
- Joined: Sun Aug 05, 2007 4:23 pm
That sucks... I had to mess with config.h (and several other source files) too. But luckily, I've got dynamic libs working, so I don't have to recompile bash when I change newlib.JamesM wrote:Heh, I made some changes to my libc and tried to recompile bash yesterday -- only to find that my doctored config.h had been overwritten. So now I can't remember what flags I had set, and bash keeps trying to compile in stuff which requires dirent.h -- which I haven't ported yet! D'oh! I'll have to port that tonight
pcmattman: as per your request here is a progress update:
Now have bash working,executing files without panicing. Also ( ) tab autocomplete works -- I was so unbelievably shocked!
It prints out it's autocomplete list dead slowly, one char at a time. I'll have to see if it's using write() or fwrite() because some buffering should be going on.
Some builtins work, like 'time' - although my 'times()' func is still a stub so it returns all zeroes.
It's still pretty sweet tho
Now have bash working,executing files without panicing. Also ( ) tab autocomplete works -- I was so unbelievably shocked!
It prints out it's autocomplete list dead slowly, one char at a time. I'll have to see if it's using write() or fwrite() because some buffering should be going on.
Some builtins work, like 'time' - although my 'times()' func is still a stub so it returns all zeroes.
It's still pretty sweet tho
- Attachments
-
- snapshot14.png (14.87 KiB) Viewed 4059 times
-
- 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:
Wow. That's great!
I'm doing things the other way around: getting all the functionality I'll need to port bash, then porting it. So I already have a times() function, a gettimeofday() function, and I'm trying to figure out the best way to write my execve() function.
Now you just need to port GCC/binutils and then you can be fully self-hosting.
I'm doing things the other way around: getting all the functionality I'll need to port bash, then porting it. So I already have a times() function, a gettimeofday() function, and I'm trying to figure out the best way to write my execve() function.
Now you just need to port GCC/binutils and then you can be fully self-hosting.
That's the plan. However I noticed a bug in my scheduler last night and haven't managed to fix it yet. It comes out when I stick yield()s in the main() loops of my driver processes, but I can replicate it by adding a printf() line in the scheduler. Causes the program to jump to an illegal location - can't work out why atm!
-
- Member
- Posts: 37
- Joined: Sun Aug 05, 2007 4:23 pm
Is your printf safe concurency wise? Could it be that someone is printing and timer interrupt causes scheduler to run, and scheduler tries to print at the same time? I had the same problem recently when I wanted to print some debug stuff in my scheduler.JamesM wrote:but I can replicate it by adding a printf() line in the scheduler. Causes the program to jump to an illegal location - can't work out why atm!