BitOfAZeldaFan / ck

C/K, the Coffee Kernel written in C.
0 stars 0 forks source link

free/used memory tables #3

Closed BitOfAZeldaFan closed 5 years ago

BitOfAZeldaFan commented 5 years ago

assuming a limit of 1mb per table, that allows a theoretical maximum of ~105 thousand entries. (using 10-byte entries).

i can put the two memory tables in the megabytes following the kernel, assuming that my kernel doesn't get larger than 1mb.

BitOfAZeldaFan commented 5 years ago

the global memory map should be in the first 511 kb in my global variables area.

BitOfAZeldaFan commented 5 years ago

10 bytes for the memory entries. plus ill need data on number of entries in the table. struct map { uint8_t flags_info[2]; uint32_t base_address; size_t size_in_bytes; };

BitOfAZeldaFan commented 5 years ago

should I use an 8-byte table entry? then I can have exactly 131,072 entries. i will keep the 32-bit address, but limit my size to 16 bits (64kb), and have four bytes for my metadata fields.

is 64kb enough for a single block of memory? probably.

BitOfAZeldaFan commented 5 years ago

I can pit the two tables entries data and metrics in the grouping of global variables in my first megabyte section. they can all group together under mman.h