add debugging
This commit is contained in:
parent
929b399f33
commit
f233cc1066
13
Makefile
13
Makefile
|
@ -35,7 +35,7 @@ COPTIM=-O2
|
||||||
CWARNS=-Wall -Wextra -Werror=implicit-function-declaration
|
CWARNS=-Wall -Wextra -Werror=implicit-function-declaration
|
||||||
CINCLUDES=-Ikaleid/include
|
CINCLUDES=-Ikaleid/include
|
||||||
CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11
|
CFLAGS1=-nostdlib -ffreestanding -mcmodel=large -std=gnu11
|
||||||
CFLAGS2= -c -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fno-strict-aliasing
|
CFLAGS2= -c -g -mno-red-zone -mno-mmx -mno-sse -mno-sse2 -fno-strict-aliasing
|
||||||
CFLAGS=$(CFLAGS1) $(CFLAGS2)
|
CFLAGS=$(CFLAGS1) $(CFLAGS2)
|
||||||
KCC=$(CCNAME) $(COPTIM) $(CWARNS) $(CFLAGS) $(CINCLUDES) -D_OSK_SOURCE -D_KALEID_KERNEL
|
KCC=$(CCNAME) $(COPTIM) $(CWARNS) $(CFLAGS) $(CINCLUDES) -D_OSK_SOURCE -D_KALEID_KERNEL
|
||||||
|
|
||||||
|
@ -208,9 +208,18 @@ debug: all
|
||||||
.PHONY: gdb
|
.PHONY: gdb
|
||||||
gdb: all
|
gdb: all
|
||||||
@qemu-system-x86_64 -m 64M -hda build/bin/disk.img -no-reboot \
|
@qemu-system-x86_64 -m 64M -hda build/bin/disk.img -no-reboot \
|
||||||
-no-shutdown -mem-path memdump.bin -d cpu_reset,guest_errors,pcall,int -s -S 2> qemu.log &
|
-no-shutdown -mem-path memdump.bin -d cpu_reset,guest_errors,pcall,int -s 2> qemu.log &
|
||||||
@ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 64 > kaleid64_disasm.asm
|
@ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 64 > kaleid64_disasm.asm
|
||||||
@ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 32 > kaleid32_disasm.asm
|
@ndisasm $(BINDIR)/kaleid -o 0x00100000 -b 32 > kaleid32_disasm.asm
|
||||||
|
@gdb \
|
||||||
|
-ex "set arch i386:x86-64:intel" \
|
||||||
|
-ex "target remote localhost:1234" \
|
||||||
|
-ex "symbol-file $(BINDIR)/kaleid" \
|
||||||
|
-ex "break BtStartKern" \
|
||||||
|
-ex "def reload64"
|
||||||
|
-ex "set arch i386:x86-64" \
|
||||||
|
-ex "target remote localhost:1234" \
|
||||||
|
-ex "end" \
|
||||||
|
|
||||||
.PHONY: install_mbr
|
.PHONY: install_mbr
|
||||||
install_mbr: $(BINDIR)/disk.img $(MBRDIR)/grub.cfg
|
install_mbr: $(BINDIR)/disk.img $(MBRDIR)/grub.cfg
|
||||||
|
|
|
@ -163,11 +163,14 @@
|
||||||
├── ChangeLog
|
├── ChangeLog
|
||||||
├── COPYING
|
├── COPYING
|
||||||
├── grub.log
|
├── grub.log
|
||||||
|
├── kaleid32_disasm.asm
|
||||||
|
├── kaleid64_disasm.asm
|
||||||
├── loader_disasm32.asm
|
├── loader_disasm32.asm
|
||||||
├── loader_disasm64.asm
|
├── loader_disasm64.asm
|
||||||
├── Makefile
|
├── Makefile
|
||||||
|
├── memdump.bin
|
||||||
├── ProjectTree
|
├── ProjectTree
|
||||||
├── qemu.log
|
├── qemu.log
|
||||||
└── Readme.md
|
└── Readme.md
|
||||||
|
|
||||||
28 directories, 117 files
|
28 directories, 120 files
|
||||||
|
|
|
@ -30,17 +30,6 @@
|
||||||
#include <kernel/buf.h>
|
#include <kernel/buf.h>
|
||||||
#include <kernel/mm.h>
|
#include <kernel/mm.h>
|
||||||
|
|
||||||
void func(void)
|
|
||||||
{
|
|
||||||
void* p = NULL;
|
|
||||||
KernLog("%p ", (void*)&p);
|
|
||||||
|
|
||||||
for (int i = 0; i < 50; i++) { ; }
|
|
||||||
|
|
||||||
func();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// BootInfo_t initialization. It is necessary because grub will potentially be
|
// BootInfo_t initialization. It is necessary because grub will potentially be
|
||||||
|
@ -156,8 +145,6 @@ noreturn void BtStartKern(multiboot_info_t *mbInfo, int mbMagic)
|
||||||
MmInitHeap();
|
MmInitHeap();
|
||||||
PsInitSched();
|
PsInitSched();
|
||||||
|
|
||||||
func();
|
|
||||||
|
|
||||||
//Buffer_t *buf = BOpenLineBuf(NULL, BS_WRONLY, 80, 24, 1, NULL);
|
//Buffer_t *buf = BOpenLineBuf(NULL, BS_WRONLY, 80, 24, 1, NULL);
|
||||||
//error_t rc = BPrintOnBuf(buf, "%+#05x", 0xcafeb00b);
|
//error_t rc = BPrintOnBuf(buf, "%+#05x", 0xcafeb00b);
|
||||||
//if(rc)KernLog("error\n");
|
//if(rc)KernLog("error\n");
|
||||||
|
|
Loading…
Reference in New Issue