-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[kernel] Add configurable size kernel file & inode structures #119
Conversation
The final 'amendment' to this PR adds While initially sceptical to the usefulness of a This is also what brought about the
|
Glad you're liking the heap= option. Sounds like memsize= is also a great idea for debugging, may have to take that over to ELKS :)
I hadn't tried bufs=0 cache=12, but see you've changed that back to bufs=8, cache=4. Did you run into problems? I had also tried lowering tasks= to 3 or 4, but got some kernel crashes as a result (even with no /bin/init). Funny thing is that the kernel checks for tasks reaching its limit, and I haven't yet figured out why the higher task setting seems necessary. |
Thanks @ghaerr - you know, one thing leads to another. I decided to import the files= and inodes= settings, then started to play. I was sure I had bufs=0 working, then changed thing around and it stopped working. Then repeat. Now I cannot get it to work and decided to let it go for now. Then I started pushing limits and |
Keep me posted if you find out anything regarding bufs=0 or tasks=4 that actually works. It may appear to but I think there may be some problems lurking we haven't identified yet, because I tried that and couldn't get it to work. The proper failure mode should be "No tasks" displayed and fork() terminated, but instead I've seen system crashes which are not supposed to be possible. I wasn't aware that bufs=0 would work, hopefully that doesn't try to pass a zero for the size to seg_alloc - not sure what happens in that case.
ELKS has you beat there with configurations (notably ROM) that'll run in 128k RAM (running now on emu86 emulator). The variable heap size through config.h (then later heap=) was added to get the system to run in 128k at the time, a couple years ago. |
Will do. bufs=0 turns out to work fine on a very narrowed down configuration, but I need to iterate into what and at what level something breaks. The same applies to tasks= where 5 works well, multiuser boot and 2 ttys.
Unsurprisingly not enough memory to run
Can't beat that one with a disk/floppy based system I suppose. Let's see how far down I can get. Happy holidays. |
This turned out to be an interesting exercise.
Here's a 'small system'
... delivering boot messages and
|
Very interesting you've got tasks=3 running. I'll play with that and see what happens over here.
Well, unknown keywords (that don't have '=' in them) are converted to arguments to bininit= in the order they're seen. So with bininit=/bin/sh the shell is started with those arguments and likely complains. /bin/sh has to start with -c in order to run its arguments and I don't think sash handles them at all. The mechanism was designed so that any program could be run, not just a shell. Passing 'n' to /bin/init, for instance, says don't run :sysinit: (/etc/rc.sys). Bootopts isn't checking argument lists against specific programs.
Since bufs= only specifies external (L2) buffers, with cache= specifying L1 buffers, bufs=0 is working since it is ignored.
When ext buffers is configured, the buffers (including 0) are passed to seg_alloc as I explained above earlier. The likely problem is that seg_alloc doesn't check for a 0 size either.
The large serial input buffer is only required for SLIP or fast incoming data. I've been thinking about ways to allocate that only when needed. Thoughts? |
yeah, I know :-), fixed a couple of days ago.
sounds like an easy fix, I'll take a look at that.
It has been on my list to ask you about that. Seems this is a good time to take closer look. thanks! |
Not so easy as it turns out. The buffer init routine is full of #ifdefs and the condition we're looking at is outside anything considered when the code was written. After spending some time with the code, I came to the conclusion that handling such an esoteric variant 'properly' (i.e. automagically) is too expensive codewise. Instead I decided the smart thing to do was to print a warning on the console and set the buffer to 2 instead of 0. That way the system boots properly and the user can change configuration or |
The question is how should the system would know when to allocate a large or small buffer? It can't be done post-open (e.g with a program), since the open routine allocates the (large) buffer. Adding into /bootopts is yet another option which has to be changed to do SLIP or fast incoming serial I/O. We could have a |
I was thinking along the same lines, although not via |
BTW @ghaerr, what's the reasoning behind having an inode table that is larger than the file table? |
The size of the kernel file and inode tables are now configurable via the new
inodes=
andfiles=
parameters in/bootopts
. Along with the formerly introducedtasks=
parameter, this addition makes it easier to tune the system to actual usage and available resources (memory in particular).When not present, the values default to the settings in
linuxmt/config.h
which traditionally have been 64 for files and 96 for inodes.A minimal configuration for a system short on memory would be
tasks=6 bufs=8 cache=4 files=20 inodes=24
In order for a configuration this tight to complete startup properly, add
n
by itself tobootopts
to prevent/etc/rc.sys
from running.Also included is a more detailed output from the boot process indicating the max # of tasks, files and inodes in the running system:
PC/AT class, cpu 7, syscaps 0xff, 639K base ram, 14 tasks, 64 files, 96 inodes
This improvement is lifted from ELKS: ghaerr/elks#1987 (comment) and ghaerr/elks#1840 (comment) -- thanks @ghaerr.