Page 2 of 2

Re: port a libc or make one from scratch?

Posted: Sat May 16, 2020 1:43 pm
by Korona
I like that my distro doesn't need to pull 600 packages whenever libc has a security patch.

Re: port a libc or make one from scratch?

Posted: Sat May 16, 2020 2:03 pm
by iansjack
eekee wrote:Yeah, but they wouldn't even put dynamic linking in Golang which went public in 2011.
Perhaps not in 2011, but with version 1.8 they introduced the Go plugin system to allow dynamic loading of modules.

Good move.

Re: port a libc or make one from scratch?

Posted: Tue May 19, 2020 3:37 pm
by AndrewAPrice
I switched from newlib to musl in my non-POSIX OS. Wish me luck. :D

I found the source layout to be very straight forward. As a hook, I have a syscall() function with a giant switch statement. Currently 99.999999999% unimplemented, but I got printf() working.

Re: port a libc or make one from scratch?

Posted: Sat May 23, 2020 10:59 am
by eekee
Have fun Andrew! :D

I think I've got Thompson and co. figured out. Unix was a multiuser system in 64 KB, if I remember right. (Maybe 64 Kwords = 128 KB. Maybe less on the initial PDP-8.) To switch tasks, it wrote the entire program memory to disk and read in the next task's memory. Under those circumstances, I think diving tasks between little programs was a good idea, and shared libraries would have been a liability. What if one user was typesetting, another compiling a program, and a third working with, I don't know... simulating a telephony problem? Why they stuck with it is a bit harder to figure out, but I gather Ken Thompson actually couldn't get on with complexity.