pull/38/head
E. Almqvist 3 years ago
parent 95e2f274e3
commit 5654680f7e
  1. 13
      kernel/memory.c

@ -11,14 +11,13 @@
// which is (2^32)*BLOCK_SIZE blocks
// and with a blocksize of 1024, we git around 4.3 trillion blocks
// which is more than enough
int bitmap = 0;
enum bitmap_flag {
FREE,
ALLOC
};
void mod_bitmap(uint block, uint bit, uint bflag) {
// create a bitmask that will be applied to the bitmap
int bitmask = 1 << bit;
// apply the bitmask, resulting in the bit:n bit will bet
// set to bflag
bitmap = (((bitmap & ~bitmask)) | (bflag << bit));
}

Loading…
Cancel
Save