Swap support
Hi all!!
Yesterday I commited to the CVS some experimental swap support code, based on Alan's work on the subject. Ofcourse this code is not included in the default configuration and is not for _actual_ use, since as I said is experimental. Apart from that if you set the swap partition in malloc.c you and enable swapping you can enjoy an 8086 system use _virtual_ memory!
I also added a utility named "meminfo" in the elkscmd package under the sys_utils directory to monitor the memory usage.
Harry
Quoted 1 line · Harry Kalogirou
'> Yesterday I commited to the CVS some experimental swap support code,
Quoted 6 lines
based on Alan's work on the subject. Ofcourse this code is not included in the default configuration and is not for _actual_ use, since as I said is experimental. Apart from that if you set the swap partition in
malloc.cyou and enable swapping you can enjoy an 8086 system use _virtual_ memory!
Great!
I've been looking for it in the code, and found nothing about it's
configuration (setting the partition and the size, activating it...)... can someone (Harry, Alan) give us a few words about how to do so?
And by the way... can you write a technical description about how is it
done? The main problem with swap in minix was (is) that processes waiting for IO (waiting for a message from FS) can not be swapped in, because they would meet a deadlock when trying to swap out (for FS is needed again to do the swapping out, but it is frozen sending the message to the process, because FS is not reentrant/concurrent in minix)... and obviously processes waiting for IO are those best suited to be swapped in.
Excuse my bad English... from memory to disk is "swap in" or "swap
out"?
Signature · 9 lines
Daría todo lo que sé por la mitad de lo que ignoro -------- Javier Sedano Jarillo http://www.it.uc3m.es/~jsedano [email protected] (*) [email protected] - To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 26 lines · Javier Sedano
Harry Kalogirou wrote:
'> Yesterday I commited to the CVS some experimental swap support code,
Quoted 7 lines
based on Alan's work on the subject. Ofcourse this code is not included in the default configuration and is not for _actual_ use, since as I said is experimental. Apart from that if you set the swap partition in
malloc.cyou and enable swapping you can enjoy an 8086 system use _virtual_ memory!Great!
I've been looking for it in the code, and found nothing about it's
configuration (setting the partition and the size, activating it...)... can someone (Harry, Alan) give us a few words about how to do so?
And by the way... can you write a technical description about how is it
done? The main problem with swap in minix was (is) that processes waiting for IO (waiting for a message from FS) can not be swapped in, because they would meet a deadlock when trying to swap out (for FS is needed again to do the swapping out, but it is frozen sending the message to the process, because FS is not reentrant/concurrent in minix)... and obviously processes waiting for IO are those best suited to be swapped in.
Quoted 2 lines
Excuse my bad English... from memory to disk is "swap in" or "swap
out"?
Your English is fine, and I'd say "swap out" indicates memory to disk.
Dave
Την Δευ, 22-04-2002 στις 16:42, ο/η Javier Sedano έγραψε:
Quoted 10 lines
Quoted 1 line · Harry Kalogirou
'> Yesterday I commited to the CVS some experimental swap support code,
Quoted 6 lines
based on Alan's work on the subject. Ofcourse this code is not included in the default configuration and is not for _actual_ use, since as I said is experimental. Apart from that if you set the swap partition in
malloc.cyou and enable swapping you can enjoy an 8086 system use _virtual_ memory!
Quoted 5 lines
Great!
I've been looking for it in the code, and found nothing about it's
configuration (setting the partition and the size, activating it...)... can someone (Harry, Alan) give us a few words about how to do so?
I will focus on making it easily configurable at run time later along with documenting it a bit. Basicaly the code now is a 4 hour brain storm. To configure it you basicaly change this part of the code :
holep = &swap_holes[0]; holep->flags = HOLE_FREE; holep->page_base = 0; holep->extent = 128; holep->refcount = 0; holep->next = NULL; swap_dev = 0x0100;
The extent is the size in kilobytes and the swap_dev is the block device to swap to. In the example 0x0100 is /dev/ram0
Quoted 2 lines
And by the way... can you write a technical description about how is it
done? The main problem with swap in minix was (is) that processes
It's on my TODO list...
Quoted 7 lines
waiting for IO (waiting for a message from FS) can not be swapped in, because they would meet a deadlock when trying to swap out (for FS is needed again to do the swapping out, but it is frozen sending the message to the process, because FS is not reentrant/concurrent in minix)... and obviously processes waiting for IO are those best suited to be swapped in.
As you might already noticed we don't use the FS layer, we only support swapping to a device at the momment. Once the think works we can add swapping to file easily. For the minix matter now - our FS is reentrant so we will have no problem...
Harry
Hi Harry.
Quoted 28 lines
Quoted 7 lines
Quoted 6 lines
Yesterday I commited to the CVS some experimental swap support code, based on Alan's work on the subject. Of course this code is not included in the default configuration and is not for _actual_ use, since as I said is experimental. Apart from that if you set the swap partition in
malloc.cyou and enable swapping you can enjoy an 8086 system use _virtual_ memory!Quoted 6 lines
Great!
I've been looking for it in the code, and found nothing about it's configuration (setting the partition and the size, activating it...)... can someone (Harry, Alan) give us a few words about how to do so?
I will focus on making it easily configurable at run time later along with documenting it a bit. Basicaly the code now is a 4 hour brain storm. To configure it you basicaly change this part of the code :
holep = &swap_holes[0]; holep->flags = HOLE_FREE; holep->page_base = 0; holep->extent = 128; holep->refcount = 0; holep->next = NULL; swap_dev = 0x0100;
Quoted 2 lines
The extent is the size in kilobytes and the
swap_devis the block device to swap to. In the example0x0100is/dev/ram0for example.
Would you mind if I tweaked the config system to allow this to be configured therein, making the entire configuration dependent on the CONFIG_EXPERIMENTAL config variable?
Also, does it use any particular format for the swap partition? I'm presuming from the above that it operates at partition level rather than at device level, so doesn't require a separate hard drive for swap usage.
Quoted 4 lines
Quoted 2 lines
And by the way... can you write a technical description about how it is done?
It's on my TODO list...
I'll have a look as well, and see what I can come up with once I've finished ANSI'fying the source tree.
Quoted 11 lines
Quoted 7 lines
The main problem with swap in minix was (is) that processes waiting for IO (waiting for a message from FS) can not be swapped in, because they would meet a deadlock when trying to swap out (for FS is needed again to do the swapping out, but it is frozen sending the message to the process, because FS is not reentrant/concurrent in minix)... and obviously processes waiting for IO are those best suited to be swapped in.
As you might already noticed we don't use the FS layer, we only support swapping to a device at the moment. Once the thing works we can add swapping to file easily.
That's the best way to do it, IMHO.
Quoted 2 lines
For the minix matter now - our FS is reentrant so we will have no problem...
That's one less thing to worry about.
Best wishes from Riley.
Την Δευ, 22-04-2002 στις 21:18, ο/η Riley Williams έγραψε:
Quoted 3 lines
Would you mind if I tweaked the config system to allow this to be configured therein, making the entire configuration dependent on the
CONFIG_EXPERIMENTALconfig variable?
Yes make it dependent on CONFIG_EXPERIMENTAL, as for the configuration of the swap partition leave it as it is now, since it is only for developers at the moment...
Quoted 4 lines
Also, does it use any particular format for the swap partition? I'm presuming from the above that it operates at partition level rather than at device level, so doesn't require a separate hard drive for swap usage.
There is no need to format the block device(partition) to be used...
Harry
Introduction and proposal:
Hello all,
I have recently joined this list, and would like to introduce myself:
Hi im Erich.
Anyway, Ive been playing with ELKS on my 286 laptop for a couple of weeks now, and i think its way cool. Especially since the hard disk has long since been kaput.
Ive read a couple emails about the documentation for this project, and I concur that it does need improvement. I would like to help out with documenting this project, while I learn enough about the OS to maybe start helping with code.
One of the things Ive thought would be neat, is a guide to the source code of ELKS, like a programmers manual. Is this something that is needed? Or would my time be better spent working on other documentation?
Another of the projects related to ELKS that ive been considering, is a good vt100 emulator, and/or a serial library that would make ELKS good for controlling devices over a serial line, but I wont be able to consider working on that till the end of the summer at the earliest.
Anyway, thats all from me, I just figured I would consult you all about the documentation thing.
Erich Heine
Re: Introduction and proposal:
Hi Erich.
Quoted 3 lines
Anyway, Ive been playing with ELKS on my 286 laptop for a couple of weeks now, and i think its way cool. Especially since the hard disk has long since been kaput.
It's good to see others are interested. Welcome aboard.
Quoted 4 lines
I've read a couple emails about the documentation for this project, and I concur that it does need improvement. I would like to help out with documenting this project, while I learn enough about the OS to maybe start helping with code.
You're certainly welcome to do that.
Quoted 4 lines
One of the things I've thought would be neat, is a guide to the source code of ELKS, like a programmers manual. Is this something that is needed? Or would my time be better spent working on other documentation?
To be honest, the ELKS documentation in general falls into one or more of the following categories:
1. Hopelessly out of date.
2. Abysmal English. Apparently, the non-English versions are far easier to follow than the English ones. (I can't confirm this as the only three languages I speak with anything approaching fluency are English and American).
3. Ambiguous phraseology, largely as a result of (1) above.
Anything you can do to help with ANY of the ELKS documentation that currently exists, or to create QUALITY new documentation, would be appreciated by far more than just me.
Quoted 5 lines
Another of the projects related to ELKS that I've been considering, is a good vt100 emulator, and/or a serial library that would make ELKS good for controlling devices over a serial line, but I won't be able to consider working on that till the end of the summer at the earliest.
I started on a VT100 emulator a while back, but got little further than documenting some of the control sequences used. ELKS itself uses VT52 sequences for video control, so the emulator would basically consist of a tool that receives VT100 sequences and generates the equivalent VT52 sequence. If you're interested, I have a genuine VT100 manual that lists all the codes supported by the hardware in question.
As regards the serial library, ELKS already supports SLIP links, and I understand that requires the kernel to provide pretty much complete serial support, so that is probably an unnecessary project.
Quoted 2 lines
Anyway, thats all from me, I just figured I would consult you all about the documentation thing.
The basic instruction there has to be "Go ahead".
Best wishes from Riley.
Re: Introduction and proposal:
Την Δευ, 22-04-2002 στις 23:58, ο/η Riley Williams έγραψε:
Quoted 7 lines
Hi Erich.
As regards the serial library, ELKS already supports SLIP links, and I understand that requires the kernel to provide pretty much complete serial support, so that is probably an unnecessary project.
Actualy the serial driver needs some work. Flow control is the priority one and modem control lines is priority two...
Harry
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Introduction and proposal:
Hi Harry.
Quoted 6 lines
Quoted 3 lines
As regards the serial library, ELKS already supports SLIP links, and I understand that requires the kernel to provide pretty much complete serial support, so that is probably an unnecessary project.
Actualy the serial driver needs some work. Flow control is the priority one and modem control lines is priority two...
Surely that's back to front? The primary flow control is via the CTS and RTS modem control lines, so flow control can't be fully implemented before the modem control lines have been implemented.
Best wishes from Riley.
Re: Introduction and proposal:
In reply to erich alfred heineΤην Δευ, 22-04-2002 στις 23:19, ο/η erich alfred heine έγραψε:
Quoted 5 lines
Hello all,
I have recently joined this list, and would like to introduce myself:
Hi im Erich.
Nice to meet you!
The only thing I know is that we need documentators badly!!
Harry
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Introduction and proposal:Documentation
Re Erich's comments:
Documentation is needed - I've tried to do a source code html browser but the code keeps changing! Does anyone know of an API for CVS that I can use with PHP?
Tom
__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
Re: Introduction and proposal:Documentation
Wouldnt the LXR engine be able to do that...?
I dont know much about it, but i could look into it, after finals are over (a week or 2).
Erich Heine
Quoted 19 lines · On Tue, 23 Apr 2002, [iso-8859-1] tom potts wrote:
Re Erich's comments:
Documentation is needed - I've tried to do a source code html browser but the code keeps changing! Does anyone know of an API for CVS that I can use with PHP?
Tom__________________________________________________
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts
http://uk.my.yahoo.com
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Harry.
Quoted 7 lines
Quoted 3 lines
Would you mind if I tweaked the config system to allow this to be configured therein, making the entire configuration dependent on the
CONFIG_EXPERIMENTALconfig variable?Yes make it dependent on
CONFIG_EXPERIMENTAL, as for the configuration of the swap partition leave it as it is now, since it is only for developers at the moment...
No problem. There's two thing that strike me though:
1. Does it actually make sense to use a ramdisk as a swap drive?
2. If we're using a hard drive partition as a swap partition, doesn't the kernel already know the size of that partition?
If (2) is true, then the extents field is not one needing configuration anyway as we can just grab the value the kernel has already determined earlier in the boot process. At least, I hope it has, as it doesn't make sense for the swap code to be enabled prior to our autoprobing for the hard drive partition sizes.
Quoted 3 lines
Quoted 1 line
Also, does it use any particular format for the swap partition?
There is no need to format the block device (partition) to be used...
True, but it misses what I was asking. Basically, are we emulating the Linux swap code in this respect, in that we store a swap signature at the start of the swap partition, or are we just using the partition raw?
Quoted 3 lines
Quoted 3 lines
I'm presuming from the above that it operates at partition level rather than at device level, so doesn't require a separate hard drive for swap usage.
This comment was because your previous phraseology implied that we used [say] /dev/edb as the swap device, but I suspect we're more likely to be using [say] /dev/edb1 instead.
Best wishes from Riley.
Την Δευ, 22-04-2002 στις 23:35, ο/η Riley Williams έγραψε:
Quoted 6 lines
Hi Harry.
Quoted 3 lines
Quoted 3 lines
Would you mind if I tweaked the config system to allow this to be configured therein, making the entire configuration dependent on the
CONFIG_EXPERIMENTALconfig variable?
Quoted 7 lines
Quoted 3 lines
Yes make it dependent on
CONFIG_EXPERIMENTAL, as for the configuration of the swap partition leave it as it is now, since it is only for developers at the moment...No problem. There's two thing that strike me though:
1. Does it actually make sense to use a ramdisk as a swap drive?
For now it does only for debuging. Later if and when we have ramdrives that use memory after 1MB(on 286) it will make sense for more than debuging....
Quoted 2 lines
2. If we're using a hard drive partition as a swap partition, doesn't the kernel already know the size of that partition?
Yes it does and the swapper will use that info in the next versions. I just hardcoded in for now since the ramdisk driver does not inform about the size of the drive and I only use the ramdisk for debuging.....
Quoted 6 lines
If (2) is true, then the extents field is not one needing configuration anyway as we can just grab the value the kernel has already determined earlier in the boot process. At least, I hope it has, as it doesn't make sense for the swap code to be enabled prior to our autoprobing for the hard drive partition sizes.
Quoted 7 lines
Quoted 3 lines
Quoted 1 line
Also, does it use any particular format for the swap partition?
There is no need to format the block device (partition) to be used...
True, but it misses what I was asking. Basically, are we emulating the Linux swap code in this respect, in that we store a swap signature at the start of the swap partition, or are we just using the partition raw?
We are using the partition _raw_. No format is needed(mkswap).
Harry
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Hi Harry.
Quoted 8 lines
Quoted 7 lines
Quoted 7 lines
Quoted 3 lines
Would you mind if I tweaked the config system to allow this to be configured therein, making the entire configuration dependent on the
CONFIG_EXPERIMENTALconfig variable?Yes make it dependent on
CONFIG_EXPERIMENTAL, as for the configuration of the swap partition leave it as it is now, since it is only for developers at the moment...
Quoted 7 lines
Quoted 3 lines
No problem. There's two thing that strike me though:
1. Does it actually make sense to use a ramdisk as a swap drive?
For now it does only for debuging. Later if and when we have ramdrives that use memory after 1MB (on 286) it will make sense for more than debuging....
Also if we have EMS cards that we support, they could be used for swap as well as ramdrives.
Quoted 6 lines
Quoted 2 lines
2. If we're using a hard drive partition as a swap partition, doesn't the kernel already know the size of that partition?
Yes it does and the swapper will use that info in the next versions. I just hardcoded in for now since the ramdisk driver does not inform about the size of the drive and I only use the ramdisk for debugging.
So what you're basically saying is that all storage device drivers need to include a facility where they can be asked the size of the drive they're controlling, if I'm understanding that right? After all, it's not something that could safely be left to even the most experienced system admin to specify, so there needs to be some means for the swap system to ask the underlying device/file what its size is.
Quoted 8 lines
Quoted 7 lines
If (2) is true, then the extents field is not one needing configuration anyway as we can just grab the value the kernel has already determined earlier in the boot process. At least, I hope it has, as it doesn't make sense for the swap code to be enabled prior to our autoprobing for the hard drive partition sizes.
Quoted 1 line
Quoted 1 line
Also, does it use any particular format for the swap partition?
Quoted 8 lines
Quoted 6 lines
Quoted 1 line
There is no need to format the block device (partition) to be used...
True, but it misses what I was asking. Basically, are we emulating the Linux swap code in this respect, in that we store a swap signature at the start of the swap partition, or are we just using the partition raw?
We are using the partition _raw_. No format is needed(mkswap).
Similar to Linux's mkswap that just drops the signature at the start of the relevant partition and exits, except our signature is 0 bytes long.
Best wishes from Riley.
Quoted 6 lines
So what you're basically saying is that all storage device drivers need to include a facility where they can be asked the size of the drive they're controlling, if I'm understanding that right? After all, it's not something that could safely be left to even the most experienced system admin to specify, so there needs to be some means for the swap system to ask the underlying device/file what its size is.
Why not just work towards having a swap partition/file system like that of Linux? Then any type of drive (hard drive, RAM drive, even floppy) could be used for swap, and the size would be known. Seems like that might make things easier in the end as well, as the same code could be used for either swap or a file system on the different types of media available. Of course raw access is fine for now, just pick a default size for testing.
Dan
Την Τρι, 23-04-2002 στις 02:03, ο/η Dan Olson έγραψε:
Quoted 7 lines
Quoted 6 lines
So what you're basically saying is that all storage device drivers need to include a facility where they can be asked the size of the drive they're controlling, if I'm understanding that right? After all, it's not something that could safely be left to even the most experienced system admin to specify, so there needs to be some means for the swap system to ask the underlying device/file what its size is.
Quoted 8 lines
Why not just work towards having a swap partition/file system like that of Linux? Then any type of drive (hard drive, RAM drive, even floppy) could be used for swap, and the size would be known. Seems like that might make things easier in the end as well, as the same code could be used for either swap or a file system on the different types of media available. Of course raw access is fine for now, just pick a default size for testing.
I just said that the ramdisk driver doesn't report it's size, others report it just fine. There is a little structure that contains the size ,among other things, of the device but ramdisk doesn't seem to update it.
Harry
Quoted 4 lines
I just said that the ramdisk driver doesn't report it's size, others report it just fine. There is a little structure that contains the size ,among other things, of the device but ramdisk doesn't seem to update it.
My bad, this should be easy to add. I was peeking at doshod.c when i was writing ramdisk driver, i must have missed the relevant part abot updating this thing. If doshd.c does it it should be no biggie (a couple of lines of code, namely in function that creates and destroys ramdisks).
Blaz Antonic
Την Τρι, 23-04-2002 στις 23:03, ο/η Blaz Antonic έγραψε:
Quoted 5 lines
Quoted 4 lines
I just said that the ramdisk driver doesn't report it's size, others report it just fine. There is a little structure that contains the size ,among other things, of the device but ramdisk doesn't seem to update it.
Quoted 8 lines
My bad, this should be easy to add. I was peeking at
doshod.cwhen i was writing ramdisk driver, i must have missed the relevant part abot updating this thing. Ifdoshd.cdoes it it should be no biggie (a couple of lines of code, namely in function that creates and destroys ramdisks).Blaz Antonic
You are right, basicaly it just needs a
blk_size[MAJOR][MINOR] = no_of_1024_byte_blocks;
Harry
-
To unsubscribe from this list: send the line "unsubscribe linux-8086" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Την Δευ, 22-04-2002 στις 21:18, ο/η Riley Williams έγραψε:
Quoted 3 lines
Would you mind if I tweaked the config system to allow this to be configured therein, making the entire configuration dependent on the
CONFIG_EXPERIMENTALconfig variable?
Yes make it dependent on CONFIG_EXPERIMENTAL, as for the configuration of the swap partition leave it as it is now, since it is only for developers at the moment...
Quoted 4 lines
Also, does it use any particular format for the swap partition? I'm presuming from the above that it operates at partition level rather than at device level, so doesn't require a separate hard drive for swap usage.
There is no need to format the block device(partition) to be used...
Harry