Day 18
Conversation
Notices
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:26 JST Drew DeVault -
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:27 JST Drew DeVault ✔️ new syscalls: dup, dup2
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:27 JST Drew DeVault Down to three missing symbols to build this (patched) version of dash: fcntl (with SETFL and SETFD), getgroups, and getcwd
There is a syscall for getgroups, but it's missing in libc.
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:27 JST Drew DeVault Yeah, it turns out that getcwd is a massive bitch to implement
I'm just going to write a shitty/buggy implementation and move on for now
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:28 JST Drew DeVault I think I'll end up having to open(cwd + "/..") in a loop until cwd == ".." to construct the path, or at least something like that
Or add a direntry cache like Linux has, but that would be a fair bit of work
Or, shit, I could just stick a cwd string on the process structure and live with the fact that it breaks if the cwd moves underneath you
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:29 JST Drew DeVault Progress towards shell: I have some dash patches that almost build; 11 libc functions remain. These are mostly going to involve shimming out signal-handling functions until I implement them in the kernel.
I have 44 coreutils from sbase building in my sysroot (e.g. grep, sed, od, uniq, etc)
A keyboard driver and console thing for an interactive shell remains to be done in the kernel
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:29 JST Drew DeVault Funnily enough, of all of the syscalls I have left to implement before I can finish porting dash, I suspect getcwd will be the most difficult.
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:30 JST Drew DeVault pipe(2)
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:30 JST Drew DeVault As a matter of interest:
https://git.sr.ht/~sircmpwn/bunnix/tree/master/item/sys/fs/pipe.ha
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:30 JST Drew DeVault Day 17 so far:
* New syscalls: chdir, fchdir, pipe; getpid/getppid removed, replaced with getcreds (also does uid, gid, euid, sid, etc)
* Mountpoints refactored to live on inodes, all *at (e.g. openat) syscalls finished
* C++ running in userspace (ugh, needed for a future gcc port)
* Bunnix target patched into binutils & gcc cross toolchain, proper sysroot set up
* libc expanded: dirent, getopt, stat, time, plus riggings for the new syscalls (e.g. pipe, getuid) -
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:31 JST Drew DeVault "success"
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:31 JST Drew DeVault So, in the morning of day 17, I have three languages running in userspace: Hare, C, and C++
I will keep fleshing out libc and the necessary syscalls until we have a shell. I suspect there is another scheduler bug as well.
Coming up soon: pipe(2), dup(2), fcntl(2)
-
Drew DeVault (drewdevault@fosstodon.org)'s status on Tuesday, 21-May-2024 20:35:32 JST Drew DeVault Another day, another GCC cross compiler
-