Skip to content

Commit

Permalink
Update example in /bootopts, enhance meminfo display types
Browse files Browse the repository at this point in the history
  • Loading branch information
ghaerr committed Sep 4, 2024
1 parent f86877c commit d6970b0
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion elks/fs/buffer.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ int INITPROC buffer_init(void)
debug_setcallback(1, list_buffer_status); /* ^O will generate buffer list */
#endif

if (!(L1buf = heap_alloc(nr_map_bufs * BLOCK_SIZE, HEAP_TAG_BUFHEAD|HEAP_TAG_CLEAR)))
if (!(L1buf = heap_alloc(nr_map_bufs * BLOCK_SIZE, HEAP_TAG_CACHE|HEAP_TAG_CLEAR)))
return 1;

buffer_heads = heap_alloc(bufs_to_alloc * sizeof(struct buffer_head),
Expand Down
2 changes: 1 addition & 1 deletion elks/include/linuxmt/heap.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#define HEAP_TAG_PIPE 0x06 /* open pipe buffers */
#define HEAP_TAG_INODE 0x07 /* system inodes */
#define HEAP_TAG_FILE 0x08 /* system open files */

#define HEAP_TAG_CACHE 0x09 /* L1 cache buffer */

// TODO: move free list node from header to body
// to reduce overhead for allocated block
Expand Down
15 changes: 6 additions & 9 deletions elkscmd/rootfs_template/bootopts
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,16 @@
#wd0=10,0x300,0xCC00,0x80
#3c0=11,0x330,,0x80
#comirq=,,7,10
#buf=8 # L2
#cache=4
#xmsbuf=2975
#umb=0xC000:0x800,0xD000:0x1000
#task=16
#inode=96
#file=64
#sync=30 # secs
#task=16 buf=64 cache=8 file=64 inode=96 heap=44000 # std
#task=6 buf=8 cache=4 file=20 inode=24 heap=15000 n # min w/no rc.sys
#sync=30
#init=/bin/init 3 n # muser serial no rc.sys
#init=/bin/sh # singleuser sh
#root=hda1 ro # root hd partition 1 readonly
#init=/bin/sash # singleuser sh
#root=df0
#root=hda1 ro
#kstack
#strace
#root=df0
#debug net=ne0
#console=ttyS0,19200 3
4 changes: 2 additions & 2 deletions elkscmd/sys_utils/meminfo.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ void dump_heap(int fd)
word_t total_free = 0;
long total_segsize = 0;
static char *heaptype[] =
{ "free", "SEG ", "DRVR", "TTY ", "TASK", "BUFH", "PIPE", "INOD", "FILE" };
{ "free", "MEM ", "DRVR", "TTY ", "TASK", "BUFH", "PIPE", "INOD", "FILE", "CACH"};
static char *segtype[] =
{ "free", "CSEG", "DSEG", "DDAT", "FDAT", "BUF ", "RDSK" };

Expand Down Expand Up @@ -126,7 +126,7 @@ void dump_heap(int fd)
segflags == SEG_FLAG_DDAT || segflags == SEG_FLAG_FDAT));
tty = (tag == HEAP_TAG_TTY || tag == HEAP_TAG_DRVR);
buffer = (tag == HEAP_TAG_SEG && segflags == SEG_FLAG_EXTBUF)
|| tag == HEAP_TAG_BUFHEAD || tag == HEAP_TAG_PIPE;
|| tag == HEAP_TAG_BUFHEAD || tag == HEAP_TAG_CACHE || tag == HEAP_TAG_PIPE;
system = (tag == HEAP_TAG_TASK || tag == HEAP_TAG_INODE || tag == HEAP_TAG_FILE);

if (allflag ||
Expand Down

0 comments on commit d6970b0

Please sign in to comment.