Skip to content

Commit

Permalink
[kernel] Drop process swapping
Browse files Browse the repository at this point in the history
  • Loading branch information
mfld-fr committed Feb 4, 2020
1 parent ccbe958 commit 974ac00
Show file tree
Hide file tree
Showing 15 changed files with 19 additions and 421 deletions.
7 changes: 3 additions & 4 deletions elks/arch/i86/boot/bootsect.S
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,8 @@ SETUPSEG = DEF_SETUPSEG
SYSSEG = DEF_SYSSEG /* system loaded at 0x10000 (65536). */
SYSSEGB = DEF_SYSSEG + 2

// ROOT_DEV & SWAP_DEV are now written by "build".
// ROOT_DEV is now written by "build".
ROOT_DEV = 0
SWAP_DEV = 0

#ifndef SVGA_MODE
#define SVGA_MODE VGA_ASK
Expand Down Expand Up @@ -564,8 +563,8 @@ root_flags:
.word ROOTFLAGS
syssize:
.word SYSSIZE
swap_dev:
.word SWAP_DEV
unused:
.word 0
ram_size:
.word RAMDISK
vid_mode:
Expand Down
7 changes: 3 additions & 4 deletions elks/arch/i86/boot/netbootsect.S
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ INITSEG = DEF_INITSEG ! we move boot here - out of the way
SYSSEG = DEF_SYSSEG ! system loaded at 0x10000 (65536).
SYSSEGB = DEF_SYSSEG + 2

! ROOT_DEV & SWAP_DEV are now written by "build".
! ROOT_DEV is now written by "build".
ROOT_DEV = 0
SWAP_DEV = 0
#ifndef SVGA_MODE
#define SVGA_MODE VGA_ASK
#endif
Expand Down Expand Up @@ -93,8 +92,8 @@ root_flags:
.word ROOTFLAGS
syssize:
.word SYSSIZE
swap_dev:
.word SWAP_DEV
unused:
.word 0
ram_size:
.word RAMDISK
vid_mode:
Expand Down
2 changes: 1 addition & 1 deletion elks/arch/i86/boot/setup.S
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
! 0x1f1: SETUPSECS
! 0x1f2: ROOTFLAGS
! 0x1f4: SYSSIZE
! 0x1f6: SWAP_DEV
! 0x1f6: unused (was SWAP_DEV)
! 0x1f8: RAMDISK
! 0x1fa: SVGA_MODE
! 0x1fc: ROOT_DEV
Expand Down
1 change: 0 additions & 1 deletion elks/arch/i86/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ CONFIG_APM=y
# CONFIG_MEM_TABLE is not set
CONFIG_MEM_LIST=y
CONFIG_ADVANCED_MM=y
# CONFIG_SWAP is not set
CONFIG_SMALL_KERNEL=y
CONFIG_SYS_VERSION=y
# CONFIG_STRACE is not set
Expand Down
2 changes: 1 addition & 1 deletion elks/arch/i86/drivers/block/blk.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct request {
__u8 rq_status;
sector_t rq_sector;
char *rq_buffer;
seg_t rq_seg; /* Used by swapper */
seg_t rq_seg;
struct buffer_head *rq_bh;
struct request *rq_next;

Expand Down
2 changes: 1 addition & 1 deletion elks/arch/i86/drivers/block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ static int msdos_partition(struct gendisk *hd,
hd->sizes[minor] = (int) (hdp->nr_sects >> (BLOCK_SIZE_BITS - 9));
extended_partition(hd, MKDEV(hd->major, minor));
printk(" >");
/* prevent someone doing mkfs or mkswap on an
/* prevent someone doing mkfs on an
* extended partition, but leave room for LILO */
if (hdp->nr_sects > 2)
hdp->nr_sects = 2;
Expand Down
21 changes: 1 addition & 20 deletions elks/arch/i86/drivers/char/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ int kmem_ioctl(struct inode *inode, struct file *file, int cmd, register char *a
{
struct mem_usage mu;

#ifdef CONFIG_SWAP
struct mem_swap_info si;
#endif

debugmem1("[k]mem_ioctl() %d\n", cmd);
switch (cmd) {

Expand Down Expand Up @@ -196,24 +192,9 @@ int kmem_ioctl(struct inode *inode, struct file *file, int cmd, register char *a
mu.free_memory = mm_get_usage(MM_MEM, 0);
mu.used_memory = mm_get_usage(MM_MEM, 1);

#ifdef CONFIG_SWAP
mu.free_swap = mm_get_usage(MM_SWAP, 0);
mu.used_swap = mm_get_usage(MM_SWAP, 1);
#else
mu.free_swap = mu.used_swap = 0;
#endif

memcpy_tofs(arg, &mu, sizeof(struct mem_usage));

return 0;

#ifdef CONFIG_SWAP
case MEM_SETSWAP:
if (!suser())
return -EPERM;
memcpy_fromfs(&si, arg, sizeof(struct mem_swap_info));
return mm_swap_on(&si);
#endif
}
return -EINVAL;
}
Expand Down Expand Up @@ -314,7 +295,7 @@ int memory_open(register struct inode *inode, struct file *filp)
NULL, /* */

/* The following two entries assume that virtual memory is identical
* to physical memory. Is this still true now we have swap?
* to physical memory.
*/

&kmem_fops, /* DEV_MEM_MINOR */
Expand Down
Loading

0 comments on commit 974ac00

Please sign in to comment.