added kprintf and kprintp as random useful things to have
also changed bochsrc master path to jos.iso
This commit is contained in:
parent
c5c518cbdf
commit
d1866c5e93
@ -2,7 +2,7 @@ megs: 32
|
|||||||
display_library: x, options="gui_debug"
|
display_library: x, options="gui_debug"
|
||||||
romimage: file=/usr/share/bochs/BIOS-bochs-latest
|
romimage: file=/usr/share/bochs/BIOS-bochs-latest
|
||||||
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest
|
vgaromimage: file=/usr/share/bochs/VGABIOS-lgpl-latest
|
||||||
ata0-master: type=cdrom, path=os.iso, status=inserted
|
ata0-master: type=cdrom, path=jos.iso, status=inserted
|
||||||
boot: cdrom
|
boot: cdrom
|
||||||
log: bochslog.txt
|
log: bochslog.txt
|
||||||
clock: sync=realtime, time0=local
|
clock: sync=realtime, time0=local
|
||||||
|
15
kernel.c
15
kernel.c
@ -11,6 +11,21 @@ void kinit() {
|
|||||||
test_dispatcher();
|
test_dispatcher();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void kprintp(const u32 ptr) {
|
||||||
|
// Prints our hex version of whatever is given
|
||||||
|
const char _chars[] = "0123456789abcdef";
|
||||||
|
u32 idx = 0; // used as hash into the _chars mapping
|
||||||
|
// iterate over each nibble
|
||||||
|
for(u32 i = 0 ;i < 7;i++) {
|
||||||
|
idx = (ptr << (i * 4)) & 0xf0000000;
|
||||||
|
idx = idx >> 28;
|
||||||
|
putch(_chars[idx]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void kprints(const char* s) {
|
||||||
|
printf(s);
|
||||||
|
}
|
||||||
|
|
||||||
void kmain() {
|
void kmain() {
|
||||||
kinit();
|
kinit();
|
||||||
|
Loading…
Reference in New Issue
Block a user