Bitmap bugs

pull/38/head
E. Almqvist 3 years ago
parent 684785a49d
commit c1c9248e1e
  1. 8
      drivers/vga.c
  2. 1
      drivers/vga.h
  3. 5
      kernel/memory.c

@ -2,6 +2,7 @@
#include "vga.h"
#include "../kernel/io.h"
#include "../lib/str.h"
#include "../lib/strf.h"
static unsigned int cursor_row = 0;
static unsigned int cursor_col = 0;
@ -69,6 +70,13 @@ void println(char* str, int attribute_byte) {
cursor_row++; // Increment to next y-pos (newline)
}
void printint(int i, int attribute_byte) {
char* strbuf;
strbuf = int_to_str(i, strbuf);
println(strbuf, attribute_byte);
}
void printalign(char* str, int attribute_byte, enum align alignment) {
unsigned int strlenbuf = strlen(str);

@ -17,5 +17,6 @@ void clear_row(unsigned int row);
void set_cursor_pos();
void print();
void println();
void printint(int i, int attribute_byte);
void printalign(char* str, int attribute_byte, enum align alignment);
void vga_init();

@ -15,7 +15,7 @@
#define CHECK_BITMAP(map, idx) ((map) & (1<<(idx)))
int bitmap = 0;
static int bitmap = 0;
void mod_bitmap(uint bit, uint bflag) {
// create a bitmask that will be applied to the bitmap
int bitmask = 1 << bit;
@ -38,7 +38,8 @@ int block_alloc(uint blockidx) {
return 0; // placeholder
} else {
println("ERROR! Attemped to allocate non-free block.", 0x0c);
println(block_bflag, 0x9c);
printint(block_bflag, 0x9c);
return -1;
}
}

Loading…
Cancel
Save