Hallo Bart and Steffen,

It goes all the way back to kernel 2024a released Apr 16 2001. Before that
kernel there was a p_0() function in task.c.

Around that time we were making huge gains in the memory usage of the
kernel. First Tom implemented HMA support (before that the resident part
of the kernel was in a fixed location in low memory).

At that point the init code was already seperated from the rest, but the
init data was not. First Tom implemented "claiminit" which meant that the
data segment for the init code was still the same as for the resident code
but was later claimed back. This was however quite tricky because the init
code itself allocates memory and you'd easily create a hole that way.

So the next step was to give the init code its own data segment and stack.
Easiest way was to run the init code in the "tiny" model.

Thanks for this important and interesting tour in history! Sounds like division of Siam twins! ;-) Now the INIT and RESIDENT part have almost nothing in common except... sharing same executable ;-)


This however meant that p_0() could no longer be in task.c. Problem is:
"which stack should p_0() use?"

Not the init stack, as it is overwritten.
Also none of the three kernel stacks. These can be used by any DOS call.

And I decided it was not worth the effort to create another stack just for
p_0...

Sounds like you've given up almost before you could succeed! It happens...


It can be done though (look at ker2023e.zip from ibiblio):

Got it.


* the whole chunk of kernel() in main.c line 394 will need to be moved to
  a p_0 procedure in task.c
* that chunk needs to be replaced by a
  init_call_p_0()
* init_call_p_0() will need to (in a .asm file):
  set SS and DS to the DOS data segment (DGROUP, cs:[_DGROUP_])
  set SP to the top of a special p_0 stack (how many bytes for that
  stack?)
* and jump to reloc_call_p_0(), where reloc_call_p_0 is a special entry in
  kernel.asm (like the other reloc_call's).

All done. It doesn't work yet (I can only type and see my input mirrored, but the constant strings don't print). But tomorrow I'm free from classes and will devote the day to debugging it. Do you want to take a look at the patch (~14 KB) now, or only if I fail to fix it tomorrow? (The patch includes an updated DOCS/CONTRIB.TXT file by the way ;-)


Not sure when I get to this though. Of course Lucho, feel free to try and
you'll learn a bit too so you can be an expert :)

Thanks! I decided to take the challenge, albeit I know that's not enough to make me an expert ;-)


Stay tuned!
Lucho


------------------------------------------------------- SF.Net is sponsored by: Speed Start Your Linux Apps Now. Build and deploy apps & Web services for Linux with a free DVD software kit from IBM. Click Now! http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click _______________________________________________ Freedos-kernel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to