ghaerr / elks

Embeddable Linux Kernel Subset - Linux for 8086
Other
983 stars 106 forks source link

GNU branch #225

Closed mfld-fr closed 5 years ago

mfld-fr commented 6 years ago

Current version in switch-to-gnu branch is now able to login, execute some commands and run the ktcp & telnetd daemons. This issue tracks the remaining points to be addressed to reach an acceptable quality level :

jbruchon commented 6 years ago

I have long thought that removing the redundancy between the kernel and C library would be a great idea. I don't know what the best way to implement this would be though. The libc bits are statically linked into every program such that they're all stand-alone binaries and there is no support for shared libraries and dynamic loading which would make the task a breeze. How much of libc ends up in the kernel? It seems like the best route would be to add shared library support but that implies things like -fPIC which will make the code larger and slower. There seems to be no good solution I can think of.

What's this one? "Optimize the string functions (currently only in C)"

mfld-fr commented 6 years ago

I am thinking about a lower cost solution to share code between the applets than implementing the "shared object file" feature : moving the LIBC code for large functions like printf() to a standalone executable with only a code segment, restore the old "executable sticky bit" to make this executable to stay in memory, and using the interrupt vector 81h as a trampoline for such functions (same technique as for DOS extension modules).

The "Optimize the string functions (currently only in C)" is to restore the assembler implementation of some functions like memcpy(), that I temporarily disabled during the move to GCC.

mfld-fr commented 5 years ago

The switch-to-gnu branch is currently blocked because the MINIX bootblock (also known as minix.bin) is still built with dev86. Currently reworking that block... also an opportunity to simplify by directly loading the kernel from that block without the intermediate minix_elks.bin helper.

mfld-fr commented 5 years ago

Now unblocked after commit 9e038b8. Still a draft of a simplified boot process from the MINIX filesystem, with some limitations (only FD1440 supported, kernel size limited to 64K), but works well under QEMU (faster boot as intermediate 'minix_elks' boot helper was dropped).

mfld-fr commented 5 years ago

Submitted as #240.