Did a lot of things to the x86_64 build. still won't boot, though.

Crashes in PMM2. refuse to debug after ~2 days of failed debugging.
Might do tommorrow. might do it today. who knows.
This commit is contained in:
Morten Delenk 2016-06-21 15:13:41 +02:00
parent e818cdf660
commit 0e85f6616e
17 changed files with 591 additions and 41 deletions

2
gensym.sh Executable file
View file

@ -0,0 +1,2 @@
nm $1 | grep " T " | awk '{ print $1" "$3 }' > $1.sym

View file

@ -1,6 +1,6 @@
arch = x86_64
#MODE = debug
MODE = release # enables optimization
MODE = debug
#MODE = release # enables optimization
export PATH := $(HOME)/opt/bin:$(PATH)
ARCHFLAGS =
@ -14,9 +14,9 @@ else
endif
ifeq ($(MODE),debug)
CFLAGS += -g3 -DDEBUG
CPPFLAGS += -g3 -DDEBUG
CFLAGS := -g3 -DDEBUG
CPPFLAGS := -g3 -DDEBUG
else
CFLAGS += -O2
CPPFLAGS += -O2
CFLAGS := -O2
CPPFLAGS := -O2
endif

View file

@ -5,8 +5,8 @@ OBJS = $(addsuffix .o,$(basename $(SRCS)))
CPP = $(PREFIX)g++
CC = $(PREFIX)gcc
ASFLAGS = -m32
CFLAGS = -m32 -Wall -fno-stack-protector -nostdinc -Ic_include/ -I../../kernel/c_include -ffreestanding -std=c11 -fno-builtin -Werror -nostdlib -g -fpie
CPPFLAGS = -m32 -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -I../../kernel/c_include -I../../kernel/include -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fno-pie -Wno-reorder
CFLAGS += -m32 -Wall -fno-stack-protector -nostdinc -Ic_include/ -I../../kernel/c_include -ffreestanding -std=c11 -fno-builtin -Werror -nostdlib -g -fpie
CPPFLAGS += -m32 -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -I../../kernel/c_include -I../../kernel/include -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fno-pie -Wno-reorder
LDFLAGS = -r -melf_i386

View file

@ -5,8 +5,8 @@ OBJS = $(addsuffix .o,$(basename $(SRCS)))
CPP = $(PREFIX)g++
CC = $(PREFIX)gcc
ASFLAGS = -m64
CFLAGS = -m64 -Wall -fno-stack-protector -nostdinc -Ic_include/ -I../../kernel/c_include -ffreestanding -std=c11 -fno-builtin -Werror -nostdlib -g -fpie -ffreestanding -mcmodel=large -mno-red-zone -mno-mmx -mno-sse -mno-sse2
CPPFLAGS = -m64 -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -I../../kernel/c_include -I../../kernel/include -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fno-pie -Wno-reorder -ffreestanding -mcmodel=large -mno-red-zone -mno-mmx -mno-sse -mno-sse2
CFLAGS += -m64 -Wall -fno-stack-protector -nostdinc -Ic_include/ -I../../kernel/c_include -ffreestanding -std=c11 -fno-builtin -Werror -nostdlib -g -fpie -ffreestanding -mcmodel=large -mno-mmx -mno-sse -mno-sse2
CPPFLAGS += -m64 -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -I../../kernel/c_include -I../../kernel/include -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fno-pie -Wno-reorder -ffreestanding -mcmodel=large -mno-mmx -mno-sse -mno-sse2
all: $(OBJS)

View file

@ -269,7 +269,7 @@ intr_stub 212
intr_stub 213
intr_stub 214
intr_stub 215
intr_stub 4216
intr_stub 216
intr_stub 217
intr_stub 218
intr_stub 219
@ -341,7 +341,8 @@ intr_common_handler:
mov $0x10, %ax
mov %ax, %ds
mov %ax, %es
mov %rsp, %rax
mov %rsp, %rdi
add $0x80, %rsp //Respect the useless red zone.
call handleINT
mov %rax, %rsp
mov $8, %rcx

View file

@ -14,6 +14,7 @@
.extern init
.global _start
_start:
cli
finit
mov $mb_ptr, %edi
stosl
@ -48,6 +49,18 @@ x86_64_OK:
stosl
lodsl
stosl
lodsl
stosl
lodsl
stosl
lodsl
stosl
lodsl
stosl
lodsl
stosl
lodsl
stosl
//Activate PAE
mov %cr4, %eax
or $0x20, %al
@ -119,6 +132,9 @@ pmfill:
.int 0
pdptfill:
.quad 0x87
.quad 0x40000087
.quad 0x80000087
.quad 0xC0000087
.section .bss
mb_ptr:
// These 8 Bytes will never be used when the stack comes near it

View file

@ -4,9 +4,11 @@
#include <serial.hpp>
#include <textDISP.hpp>
#include <pmm.hpp>
bool epicfail=false;
auto syscall(uint32_t syscall_num, void* handle, void* args) -> void*;
extern void** progs;
namespace MTGosHAL {
auto startup() -> void;
IDT::IDT() {
//Init PIC
outb(0x20, 0x11); //Init Master-PIC
@ -37,12 +39,19 @@ namespace MTGosHAL {
struct cpu_state* new_cpu=cpu;
debug << "Interrupt 0x" << Base::HEXADECIMAL << (int) cpu->intr << " was raised.\n";
if(cpu->intr<=0x1F) {
if(epicfail) {
err << "While trying to output the stack another exception happened\n";
while(1) {
asm volatile("cli; hlt");
}
}
epicfail=true;
err << "Exception 0x" << Base::HEXADECIMAL << (int) cpu->intr << "! Kernel halted!\n";
err << "EAX = 0x" << (int)cpu->rax << " - EBX = 0x" << (int)cpu->rbx << "\n";
err << "ECX = 0x" << (int)cpu->rcx << " - EDX = 0x" << (int)cpu->rdx << "\n";
err << "ESI = 0x" << (int)cpu->rsi << " - EDI = 0x" << (int)cpu->rdi << "\n";
err << "SS:ESP = 0x" << (int)cpu->ss << ":0x" << (int)cpu->rsp << " - SS:EBP = 0x" << (int)cpu->ss << ":0x" << (int)cpu->rbp << "\n";
err << "CS:EIP = 0x" << (int)cpu->cs << ":0x" << (int)cpu->rip << " - INTR:ERR = 0x" << (int)cpu->intr << ":0x" << (int)cpu->error << "\n";
err << "RAX = 0x" << (int)cpu->rax << " - RBX = 0x" << (int)cpu->rbx << "\n";
err << "RCX = 0x" << (int)cpu->rcx << " - RDX = 0x" << (int)cpu->rdx << "\n";
err << "RSI = 0x" << (int)cpu->rsi << " - RDI = 0x" << (int)cpu->rdi << "\n";
err << "SS:RSP = 0x" << (int)cpu->ss << ":0x" << (int)cpu->rsp << " - SS:RBP = 0x" << (int)cpu->ss << ":0x" << (int)cpu->rbp << "\n";
err << "CS:RIP = 0x" << (int)cpu->cs << ":0x" << (int)cpu->rip << " - INTR:ERR = 0x" << (int)cpu->intr << ":0x" << (int)cpu->error << "\n";
err << "------ END OF REGISTER DUMP ------ ------ START OF PROGRAM LOADPOINTS ------\n";
for(int i=0;i<1024;i++) {
if(!progs[i])
@ -54,7 +63,26 @@ namespace MTGosHAL {
outb(0x43, 0xB6);
outb(0x42, (uint8_t)counter);
outb(0x42, (uint8_t)(counter>>8));
outb(0x61, inb(0x61) | 3);
//outb(0x61, inb(0x61) | 3);
err << "A detailled traceback is being output over the serial connector.\n";
debug << "Outputting 32 stacks...\n";
uint64_t *rsp=(uint64_t*)cpu->rsp;
uint64_t *rbp=(uint64_t*)cpu->rbp;
uint64_t *rip=(uint64_t*)cpu->rip;
for(int i=0;i<32;i++) {
if(!(rsp||rbp||rip))
break;
if((int64_t)(rbp-rsp)<1)
break;
debug << Base::HEXADECIMAL << "Execution at 0x" << (int64_t) rip << ":\n";
debug << "Number of local variables: 0x" << (int64_t)(rbp-rsp)-1 << "\n";
for(uintptr_t i=0;i<(uintptr_t)(rbp-rsp)-1;i++) {
debug << "0x"<< (int64_t)(i*8) << ": 0x" << (int64_t)rsp[i] << "\n";
}
rip=(uint64_t*)rbp[1];
rsp=rbp;
rbp=(uint64_t*)rbp[0];
}
while(1) {
asm volatile("cli; hlt");
}
@ -72,8 +100,15 @@ namespace MTGosHAL {
if(ivt[cpu->intr][i])
new_cpu=ivt[cpu->intr][i](new_cpu);
}
if(cpu->intr>=48)
if(cpu->intr==48)
new_cpu->rax=(uint64_t)(::syscall(cpu->rax, (void*)(cpu->rbx), (void*)(cpu->rsp)));
if(cpu->intr==49) {
startup();
for(int i=0;i<16;i++) {
if(ivt[0x20][i])
new_cpu=ivt[0x20][i](new_cpu);
}
}
return new_cpu;
}
auto IDT::request(uint8_t intr, struct cpu_state* (*handler)(struct cpu_state*)) -> bool {

View file

@ -21,7 +21,9 @@ namespace MTGosHAL {
Screen err;
Keyboard in;
Multitasking tasks;
void main(long eax, struct multiboot_info* ebx, uint64_t**** pt) {
struct multiboot_info* ebx;
void main(long eax, struct multiboot_info* mb, uint64_t**** pt) {
ebx=mb;
new (&debug) Serial();
debug << "Hello debugger! This is MTGos v00r01\nThese logs are probably very long, so please redirect the output to a file.\n";
@ -34,11 +36,11 @@ namespace MTGosHAL {
debug << "Init GDT\n";
new (&gdt) GDT();
gdt.setEntry(0, 0, 0, 0);
gdt.setEntry(1, 0, 0, 0x298);
gdt.setEntry(2, 0, 0, 0x292);
gdt.setEntry(3, 0, 0, 0x2F8);
gdt.setEntry(4, 0, 0, 0x2F2);
gdt.setEntry(5, (uint64_t)tasks.tss, sizeof(tasks.tss), GDT_FLAG_RING3 | GDT_FLAG_TSS | GDT_FLAG_PRESENT);
gdt.setEntry(1, 0, 0, GDT_FLAG_PRESENT | GDT_FLAG_64_BIT | GDT_FLAG_4K_GRAN | GDT_FLAG_RING0 | GDT_FLAG_SEGMENT | GDT_FLAG_CODESEG);
gdt.setEntry(2, 0, 0, GDT_FLAG_PRESENT | GDT_FLAG_32_BIT | GDT_FLAG_4K_GRAN | GDT_FLAG_RING0 | GDT_FLAG_SEGMENT | GDT_FLAG_DATASEG);
gdt.setEntry(3, 0, 0, GDT_FLAG_PRESENT | GDT_FLAG_64_BIT | GDT_FLAG_4K_GRAN | GDT_FLAG_RING3 | GDT_FLAG_SEGMENT | GDT_FLAG_CODESEG);
gdt.setEntry(4, 0, 0, GDT_FLAG_PRESENT | GDT_FLAG_32_BIT | GDT_FLAG_4K_GRAN | GDT_FLAG_RING3 | GDT_FLAG_SEGMENT | GDT_FLAG_DATASEG);
gdt.setEntry(5, (uint64_t)tasks.tss, sizeof(tasks.tss), GDT_FLAG_RING0 | GDT_FLAG_TSS | GDT_FLAG_PRESENT);
gdt.setEntry(6, 0, 0, GDT_FLAG_RING3 | GDT_FLAG_TSS | GDT_FLAG_PRESENT);
gdt.apply();
@ -50,7 +52,10 @@ namespace MTGosHAL {
idt.setEntry(48, (void *)((uint64_t)&intr_stub_0+768*2), SEG_KERNEL, IDT_TRAP_GATE | IDT_SEG_32_BIT | IDT_RING_3 | IDT_USED);
idt.setEntry(8, (void *)((uint64_t)&intr_stub_0+128*2), SEG_DBL_FAULT, IDT_TASK_GATE | IDT_SEG_32_BIT | IDT_RING_0 | IDT_USED);
idt.apply();
asm volatile("ltr %%ax" : : "a"(5<<3));
asm volatile("int $49"); // Finish loading GDT
}
auto startup() -> void {
//asm volatile("ltr %%ax" : : "a"(5<<3));
debug << "Init MM\n";
new (&mm) PMM(ebx);

View file

@ -5,7 +5,7 @@ namespace MTGosHAL {
return inb(port+SERIAL_LSR)&0x20;
}
auto Serial::putChar(char chr) -> void {
// if(!works)
if(!works)
return;
int tries=65535;
while(!isTransmitEmpty()) {

View file

@ -17,16 +17,16 @@ PMM2::PMM2(): pmm3() {
}
auto PMM2::markUsed(const void * addr, uint32_t length) -> bool {
uintptr_t add=(uintptr_t)addr;
uint32_t pagetid = SPLIT1_UNSHIFT(add);
uint64_t pagetid = SPLIT1_UNSHIFT(add);
//Check if used
for(uintptr_t curr_addr=add+length;curr_addr>=add;curr_addr-=0x200000) {
for(uintptr_t curr_addr=add+length;curr_addr>add;curr_addr-=0x200000) {
if(pageTable[SPLIT1_UNSHIFT(curr_addr)])
return false;
}
//Mark as used
uint64_t counter=1;
for(uintptr_t curr_addr=add+length;curr_addr>=add;curr_addr-=0x200000) {
for(uintptr_t curr_addr=add+length;curr_addr>add;curr_addr-=0x200000) {
pageTable[SPLIT1_UNSHIFT(curr_addr)]=counter++;
pmm3.markUsed((void*)curr_addr);
}

View file

@ -4,8 +4,8 @@ OBJS = $(addsuffix .o,$(basename $(SRCS)))
CPP = $(PREFIX)g++
CC = $(PREFIX)gcc
ASFLAGS = $(ARCHFLAGS)
CFLAGS = $(ARCHFLAGS) -Wall -fno-stack-protector -nostdinc -Ic_include/ -ffreestanding -std=c11 -fno-builtin -Werror -nostdlib -g -fpie
CPPFLAGS = $(ARCHFLAGS) -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fpie
CFLAGS += $(ARCHFLAGS) -Wall -fno-stack-protector -nostdinc -Ic_include/ -ffreestanding -std=c11 -fno-builtin -Werror -nostdlib -g -fpie
CPPFLAGS += $(ARCHFLAGS) -Wall -fno-stack-protector -nostdinc -std=c++14 -Iinclude/ -Ic_include/ -fno-rtti -fno-exceptions -ffreestanding -fno-builtin -Werror -nostdlib -fno-use-cxa-atexit -Wextra -Wno-unused -g -fpie
all: $(OBJS)
%.o: %.cpp

View file

@ -39,6 +39,8 @@ namespace MTGosHAL {
template <>
auto Output::operator<<<int>(int output) -> Output &;
template <>
auto Output::operator<<<long int>(long int output) -> Output &;
template <>
auto Output::operator<<<char>(char output) -> Output &;
template <>
auto Output::operator<<<char*>(char* output) -> Output &;

View file

@ -14,7 +14,8 @@ namespace MTGosHAL {
return *this;
}
template <>
auto Output::operator<<<int>(int output) -> Output & {
auto Output::operator<<<int>(int op) -> Output & {
uintptr_t output=op;
const char* chars="0123456789ABCDEF";
char buf[33];
buf[32]='\0';
@ -27,6 +28,20 @@ namespace MTGosHAL {
return *this;
}
template <>
auto Output::operator<<<long int>(long int op) -> Output & {
uint64_t output=op;
const char* chars="0123456789ABCDEF";
char buf[65];
buf[64]='\0';
char* ptr=buf+63;
do {
*(ptr--)=chars[output%base];
output/=base;
} while(output && (ptr!=buf));
puts(ptr+1);
return *this;
}
template <>
auto Output::operator<<<char>(char output) -> Output & {
putChar(output);
return *this;

View file

@ -1,6 +1,17 @@
#include <base.hpp>
#include <pmm.hpp>
#include <stdint.h>
#ifdef __LP64
#define PAGESIZE 0x200000
#define UNSHIFT(a) ((a)>>20)
#define SHIFT(a) ((a)<<20)
#define FLAGS 0x7ffff
#else
#define PAGESIZE 4096
#define UNSHIFT(a) ((a)>>12)
#define SHIFT(a) ((a)<<12)
#define FLAGS 0xfff
#endif
void *operator new(size_t size) {
return MTGosHAL::mm.alloc(size);
}
@ -24,12 +35,12 @@ namespace MTGosHAL {
auto PMM::alloc(size_t length) -> void * {
if(!head) {
//Alloc space for head
if(length+sizeof(malloc_t)<=4096) { //Small optimization. The routine for allocating more than one continuous page is terribly slow.
if(length+sizeof(malloc_t)<=PAGESIZE) { //Small optimization. The routine for allocating more than one continuous page is terribly slow.
void *tmp;
*this >> tmp;
head=(malloc_t*)tmp;
} else
head=(malloc_t*)(*this)(((length+sizeof(malloc_t))>>12)+1);
head=(malloc_t*)(*this)(UNSHIFT((length+sizeof(malloc_t)))+1);
if(!head) //The alloc() didn't work! We're out of RAM!
return nullptr;
head->len=length;
@ -42,7 +53,7 @@ namespace MTGosHAL {
malloc_t* last=nullptr;
do {
uintptr_t loc=(uintptr_t)curr+sizeof(malloc_t)+curr->len;
if((loc+length+sizeof(malloc_t))<((loc&(~0xFFF))+4096) &&
if((loc+length+sizeof(malloc_t))<((loc&(~FLAGS))+PAGESIZE) &&
((!curr->next) || (loc+length+sizeof(malloc_t))<((uintptr_t)(curr->next)))) {
malloc_t *allocd=(malloc_t *)loc;
allocd->len=length;
@ -59,12 +70,12 @@ namespace MTGosHAL {
curr=curr->next;
} while(curr);
malloc_t *allocd=nullptr;
if(length+sizeof(malloc_t)<=4096) { //Small optimization. The routine for allocating more than one continuous page is terribly slow.
if(length+sizeof(malloc_t)<=PAGESIZE) { //Small optimization. The routine for allocating more than one continuous page is terribly slow.
void *tmp;
*this >> tmp;
allocd=(malloc_t*)tmp;
} else
allocd=(malloc_t*)(*this)(((length+sizeof(malloc_t))>>12)+1);
allocd=(malloc_t*)(*this)(UNSHIFT(length+sizeof(malloc_t))+1);
if(!allocd) //The alloc() didn't work! We're out of RAM!
return nullptr;
last->next=allocd;
@ -83,8 +94,8 @@ namespace MTGosHAL {
chk--;
do {
if(curr==chk) {
uintptr_t start=((uintptr_t)chk)&(~0xFFF);
uintptr_t end=start+0x1000;
uintptr_t start=((uintptr_t)chk)&(~FLAGS);
uintptr_t end=start+PAGESIZE;
if((((uintptr_t)(curr->last)<start)||((uintptr_t)(curr->last)>=end))&&(((uintptr_t)(curr->next)>=end)||((uintptr_t)(curr->next)<start))) {
*this << (void*)start;
}

366
mtgos.sym Normal file
View file

@ -0,0 +1,366 @@
00202890 __cxa_pure_virtual
00200063 enterPaging
00203ad6 handleINT
0020282d init
002000a0 intr_stub_0
002000c0 intr_stub_1
002001e0 intr_stub_10
00200d20 intr_stub_100
00200d40 intr_stub_101
00200d60 intr_stub_102
00200d80 intr_stub_103
00200da0 intr_stub_104
00200dc0 intr_stub_105
00200de0 intr_stub_106
00200e00 intr_stub_107
00200e20 intr_stub_108
00200e40 intr_stub_109
00200200 intr_stub_11
00200e60 intr_stub_110
00200e80 intr_stub_111
00200ea0 intr_stub_112
00200ec0 intr_stub_113
00200ee0 intr_stub_114
00200f00 intr_stub_115
00200f20 intr_stub_116
00200f40 intr_stub_117
00200f60 intr_stub_118
00200f80 intr_stub_119
00200220 intr_stub_12
00200fa0 intr_stub_120
00200fc0 intr_stub_121
00200fe0 intr_stub_122
00201000 intr_stub_123
00201020 intr_stub_124
00201040 intr_stub_125
00201060 intr_stub_126
00201080 intr_stub_127
002010a0 intr_stub_128
002010c0 intr_stub_129
00200240 intr_stub_13
002010e0 intr_stub_130
00201100 intr_stub_131
00201120 intr_stub_132
00201140 intr_stub_133
00201160 intr_stub_134
00201180 intr_stub_135
002011a0 intr_stub_136
002011c0 intr_stub_137
002011e0 intr_stub_138
00201200 intr_stub_139
00200260 intr_stub_14
00201220 intr_stub_140
00201240 intr_stub_141
00201260 intr_stub_142
00201280 intr_stub_143
002012a0 intr_stub_144
002012c0 intr_stub_145
002012e0 intr_stub_146
00201300 intr_stub_147
00201320 intr_stub_148
00201340 intr_stub_149
00200280 intr_stub_15
00201360 intr_stub_150
00201380 intr_stub_151
002013a0 intr_stub_152
002013c0 intr_stub_153
002013e0 intr_stub_154
00201400 intr_stub_155
00201420 intr_stub_156
00201440 intr_stub_157
00201460 intr_stub_158
00201480 intr_stub_159
002002a0 intr_stub_16
002014a0 intr_stub_160
002014c0 intr_stub_161
002014e0 intr_stub_162
00201500 intr_stub_163
00201520 intr_stub_164
00201540 intr_stub_165
00201560 intr_stub_166
00201580 intr_stub_167
002015a0 intr_stub_168
002015c0 intr_stub_169
002002c0 intr_stub_17
002015e0 intr_stub_170
00201600 intr_stub_171
00201620 intr_stub_172
00201640 intr_stub_173
00201660 intr_stub_174
00201680 intr_stub_175
002016a0 intr_stub_176
002016c0 intr_stub_177
002016e0 intr_stub_178
00201700 intr_stub_179
002002e0 intr_stub_18
00201720 intr_stub_180
00201740 intr_stub_181
00201760 intr_stub_182
00201780 intr_stub_183
002017a0 intr_stub_184
002017c0 intr_stub_185
002017e0 intr_stub_186
00201800 intr_stub_187
00201820 intr_stub_188
00201840 intr_stub_189
00200300 intr_stub_19
00201860 intr_stub_190
00201880 intr_stub_191
002018a0 intr_stub_192
002018c0 intr_stub_193
002018e0 intr_stub_194
00201900 intr_stub_195
00201920 intr_stub_196
00201940 intr_stub_197
00201960 intr_stub_198
00201980 intr_stub_199
002000e0 intr_stub_2
00200320 intr_stub_20
002019a0 intr_stub_200
002019c0 intr_stub_201
002019e0 intr_stub_202
00201a00 intr_stub_203
00201a20 intr_stub_204
00201a40 intr_stub_205
00201a60 intr_stub_206
00201a80 intr_stub_207
00201aa0 intr_stub_208
00201ac0 intr_stub_209
00200340 intr_stub_21
00201ae0 intr_stub_210
00201b00 intr_stub_211
00201b20 intr_stub_212
00201b40 intr_stub_213
00201b60 intr_stub_214
00201b80 intr_stub_215
00201ba0 intr_stub_216
00201bc0 intr_stub_217
00201be0 intr_stub_218
00201c00 intr_stub_219
00200360 intr_stub_22
00201c20 intr_stub_220
00201c40 intr_stub_221
00201c60 intr_stub_222
00201c80 intr_stub_223
00201ca0 intr_stub_224
00201cc0 intr_stub_225
00201ce0 intr_stub_226
00201d00 intr_stub_227
00201d20 intr_stub_228
00201d40 intr_stub_229
00200380 intr_stub_23
00201d60 intr_stub_230
00201d80 intr_stub_231
00201da0 intr_stub_232
00201dc0 intr_stub_233
00201de0 intr_stub_234
00201e00 intr_stub_235
00201e20 intr_stub_236
00201e40 intr_stub_237
00201e60 intr_stub_238
00201e80 intr_stub_239
002003a0 intr_stub_24
00201ea0 intr_stub_240
00201ec0 intr_stub_241
00201ee0 intr_stub_242
00201f00 intr_stub_243
00201f20 intr_stub_244
00201f40 intr_stub_245
00201f60 intr_stub_246
00201f80 intr_stub_247
00201fa0 intr_stub_248
00201fc0 intr_stub_249
002003c0 intr_stub_25
00201fe0 intr_stub_250
00202000 intr_stub_251
00202020 intr_stub_252
00202040 intr_stub_253
00202060 intr_stub_254
00202080 intr_stub_255
002003e0 intr_stub_26
00200400 intr_stub_27
00200420 intr_stub_28
00200440 intr_stub_29
00200100 intr_stub_3
00200460 intr_stub_30
00200480 intr_stub_31
002004a0 intr_stub_32
002004c0 intr_stub_33
002004e0 intr_stub_34
00200500 intr_stub_35
00200520 intr_stub_36
00200540 intr_stub_37
00200560 intr_stub_38
00200580 intr_stub_39
00200120 intr_stub_4
002005a0 intr_stub_40
002005c0 intr_stub_41
002005e0 intr_stub_42
00200600 intr_stub_43
00200620 intr_stub_44
00200640 intr_stub_45
00200660 intr_stub_46
00200680 intr_stub_47
002006a0 intr_stub_48
002006c0 intr_stub_49
00200140 intr_stub_5
002006e0 intr_stub_50
00200700 intr_stub_51
00200720 intr_stub_52
00200740 intr_stub_53
00200760 intr_stub_54
00200780 intr_stub_55
002007a0 intr_stub_56
002007c0 intr_stub_57
002007e0 intr_stub_58
00200800 intr_stub_59
00200160 intr_stub_6
00200820 intr_stub_60
00200840 intr_stub_61
00200860 intr_stub_62
00200880 intr_stub_63
002008a0 intr_stub_64
002008c0 intr_stub_65
002008e0 intr_stub_66
00200900 intr_stub_67
00200920 intr_stub_68
00200940 intr_stub_69
00200180 intr_stub_7
00200960 intr_stub_70
00200980 intr_stub_71
002009a0 intr_stub_72
002009c0 intr_stub_73
002009e0 intr_stub_74
00200a00 intr_stub_75
00200a20 intr_stub_76
00200a40 intr_stub_77
00200a60 intr_stub_78
00200a80 intr_stub_79
002001a0 intr_stub_8
00200aa0 intr_stub_80
00200ac0 intr_stub_81
00200ae0 intr_stub_82
00200b00 intr_stub_83
00200b20 intr_stub_84
00200b40 intr_stub_85
00200b60 intr_stub_86
00200b80 intr_stub_87
00200ba0 intr_stub_88
00200bc0 intr_stub_89
002001c0 intr_stub_9
00200be0 intr_stub_90
00200c00 intr_stub_91
00200c20 intr_stub_92
00200c40 intr_stub_93
00200c60 intr_stub_94
00200c80 intr_stub_95
00200ca0 intr_stub_96
00200cc0 intr_stub_97
00200ce0 intr_stub_98
00200d00 intr_stub_99
00200000 kernel_start
00200040 loadGDT
0020005c loadIDT
00205ad5 main
0020526c memmove
00203b01 _start
00205350 strcmp
0020531e strlen
00205b84 _Z4loadP10Elf32_Ehdr
00205a65 _Z6task_av
00205a81 _Z6task_bv
00205a9d _Z6task_cv
00205ab9 _Z6task_dv
00206425 _Z7syscalljPvS_
00205a5f _Z8pid_nullv
00205ed5 _ZdaPv
00205f23 _ZdaPvm
00205a50 _ZdaPvS_
00205eb0 _ZdlPv
00205efa _ZdlPvm
00205a41 _ZdlPvS_
00202a8e _ZN8MTGosHAL12Multitasking8initTaskEPFvvE
00202be8 _ZN8MTGosHAL12Multitasking8scheduleEPNS_9cpu_stateE
002029d8 _ZN8MTGosHAL12MultitaskingC1Ev
002029d8 _ZN8MTGosHAL12MultitaskingC2Ev
002022ce _ZN8MTGosHAL3GDT5applyEv
00202182 _ZN8MTGosHAL3GDT8setEntryEijji
0020210c _ZN8MTGosHAL3GDTC1Ev
0020210c _ZN8MTGosHAL3GDTC2Ev
00202f24 _ZN8MTGosHAL3IDT5applyEv
00202f88 _ZN8MTGosHAL3IDT6handleEPNS_9cpu_stateE
00203a54 _ZN8MTGosHAL3IDT7requestEhPFPNS_9cpu_stateES2_E
00202d98 _ZN8MTGosHAL3IDT8setEntryEiPvth
00202cac _ZN8MTGosHAL3IDTC1Ev
00202cac _ZN8MTGosHAL3IDTC2Ev
002061d0 _ZN8MTGosHAL3PMM4freeEPv
00204934 _ZN8MTGosHAL3PMM4initEP14multiboot_info
00205f4c _ZN8MTGosHAL3PMM5allocEm
00204966 _ZN8MTGosHAL3PMM8markUsedEPKvm
00204902 _ZN8MTGosHAL3PMMC1Ev
00204902 _ZN8MTGosHAL3PMMC2Ev
00204a08 _ZN8MTGosHAL3PMMclEi
002049d4 _ZN8MTGosHAL3PMMlsEPKv
002049a0 _ZN8MTGosHAL3PMMrsERPv
0020232a _ZN8MTGosHAL4mainElP14multiboot_infoPPPPm
00205042 _ZN8MTGosHAL4PMM24initEP14multiboot_info
00204de0 _ZN8MTGosHAL4PMM28markUsedEPKvj
00204dba _ZN8MTGosHAL4PMM2C1Ev
00204dba _ZN8MTGosHAL4PMM2C2Ev
00204fd8 _ZN8MTGosHAL4PMM2clEi
00204f32 _ZN8MTGosHAL4PMM2lsEPKv
00204edc _ZN8MTGosHAL4PMM2rsERPv
00204a42 _ZN8MTGosHAL4PMM34initEP14multiboot_info
00204c22 _ZN8MTGosHAL4PMM38markUsedEPKv
00204a36 _ZN8MTGosHAL4PMM3C1Ev
00204a36 _ZN8MTGosHAL4PMM3C2Ev
00204d5a _ZN8MTGosHAL4PMM3lsEPKv
00204c82 _ZN8MTGosHAL4PMM3rsERPv
00205dea _ZN8MTGosHAL4Task5pauseEPNS_9cpu_stateE
00205e0c _ZN8MTGosHAL4Task7addTaskEPS0_
00205e50 _ZN8MTGosHAL4Task7hasNextEv
00205dd8 _ZN8MTGosHAL4Task7unpauseEv
00205db2 _ZN8MTGosHAL4TaskC1EPNS_9cpu_stateE
00205db2 _ZN8MTGosHAL4TaskC2EPNS_9cpu_stateE
002057f2 _ZN8MTGosHAL6Output4putsEPKc
002059c4 _ZN8MTGosHAL6OutputlsIcEERS0_T_
0020586c _ZN8MTGosHAL6OutputlsIiEERS0_T_
00205918 _ZN8MTGosHAL6OutputlsIlEERS0_T_
00205850 _ZN8MTGosHAL6OutputlsINS_4BaseEEERS0_T_
002059f4 _ZN8MTGosHAL6OutputlsIPcEERS0_T_
00203bb0 _ZN8MTGosHAL6Screen4initEP14multiboot_info
0020561e _ZN8MTGosHAL6Screen6clrscrEv
00205670 _ZN8MTGosHAL6Screen6scrollEv
00205408 _ZN8MTGosHAL6Screen7putCharEc
002057a0 _ZN8MTGosHAL6Screen8setColorENS_8BG_colorE
00205784 _ZN8MTGosHAL6Screen8setColorENS_8FG_colorE
002057bc _ZN8MTGosHAL6Screen8setColorENS_8FG_colorENS_8BG_colorE
00205768 _ZN8MTGosHAL6ScreenlsINS_8BG_colorEEERS0_T_
0020574c _ZN8MTGosHAL6ScreenlsINS_8FG_colorEEERS0_T_
002043de _ZN8MTGosHAL6Serial15isTransmitEmptyEv
002044b8 _ZN8MTGosHAL6Serial15serial_receivedEv
00204734 _ZN8MTGosHAL6Serial5debugEv
002044e8 _ZN8MTGosHAL6Serial7getCharEv
0020440e _ZN8MTGosHAL6Serial7putCharEc
002045bc _ZN8MTGosHAL6SerialC1Ev
002045bc _ZN8MTGosHAL6SerialC2Ev
00202779 _ZN8MTGosHAL7startupEv
00203dd2 _ZN8MTGosHAL8Keyboard10handleIRQ1EPNS_9cpu_stateE
00203d84 _ZN8MTGosHAL8Keyboard11sendCommandEh
00203d16 _ZN8MTGosHAL8Keyboard7getCharEv
0020422a _ZN8MTGosHAL8KeyboardC1Ev
0020422a _ZN8MTGosHAL8KeyboardC2Ev
002029ac _ZN8MTGosHAL8scheduleEPNS_9cpu_stateE
00203ceb _ZN8MTGosHAL9handleIRQEPNS_9cpu_stateE
0020636e _ZN9ScreenOut6clrscrEv
002063ac _ZN9ScreenOut8setColorE7BGColor7FGColor
002062f8 _ZN9ScreenOutC1Eb
002062f8 _ZN9ScreenOutC2Eb
0020641a _ZN9ScreenOutD1Ev
0020641a _ZN9ScreenOutD2Ev
00206312 _ZN9ScreenOutlsEPc
00205e8c _Znam
00205a2f _ZnamPv
00205e68 _Znwm
00205a1d _ZnwmPv
002045ab _ZThn16_N8MTGosHAL6Serial7getCharEv

97
output Normal file
View file

@ -0,0 +1,97 @@
Hello debugger! This is MTGos v00r01
These logs are probably very long, so please redirect the output to a file.
Init Screen output
Init GDT
We are now trying to set our GDT. If the CPU triplefaults, something went wrong in MTGosHAL::GDT::apply() or loadGDT().
Init IDT
Now trying to load the IDT.
Interrupt 0x31 was raised.
Interrupt 0xD was raised.
Outputting 32 stacks...
Execution at 0x206035:
Number of local variables: 0xB
0x0: 0x1
0x8: 0x0
0x10: 0x204406
0x18: 0x3F800800031
0x20: 0x82ADC0
0x28: 0x20449F
0x30: 0x3FD00000000
0x38: 0x800020
0x40: 0x0
0x48: 0x82ADD0
0x50: 0x204406
Execution at 0x205E88:
Number of local variables: 0x3
0x0: 0x82ADF0
0x8: 0x205E88
0x10: 0xA00000000
Execution at 0x206498:
Number of local variables: 0xB
0x0: 0x82AE50
0x8: 0x206498
0x10: 0x82AE30
0x18: 0x82AF80
0x20: 0x0
0x28: 0x800020
0x30: 0x0
0x38: 0xD00000000
0x40: 0x0
0x48: 0x206572
0x50: 0x6001E2
Execution at 0x2039CC:
Number of local variables: 0x11
0x0: 0x82AEE0
0x8: 0x2039CC
0x10: 0x82AE90
0x18: 0x8000C0
0x20: 0x0
0x28: 0x0
0x30: 0x1000000000
0x38: 0x0
0x40: 0x0
0x48: 0x0
0x50: 0x0
0x58: 0x0
0x60: 0x0
0x68: 0x82AE90
0x70: 0x400008
0x78: 0x0
0x80: 0x0
Execution at 0x203AFF:
Number of local variables: 0x3
0x0: 0x82AF00
0x8: 0x203AFF
0x10: 0xA
Execution at 0x2020CE:
Number of local variables: 0x15
0x0: 0x82AFB0
0x8: 0x2020CE
0x10: 0x208D00002801A0
0x18: 0x0
0x20: 0x200000002801A0
0x28: 0x0
0x30: 0x0
0x38: 0x0
0x40: 0x0
0x48: 0x31
0x50: 0x0
0x58: 0x202776
0x60: 0x18
0x68: 0x6
0x70: 0x82AF80
0x78: 0x10
0x80: 0x0
0x88: 0x82B000
0x90: 0x10000
0x98: 0x2BADB002
0xA0: 0x0
Execution at 0x20285F:
Number of local variables: 0x7
0x0: 0x82AFF0
0x8: 0x20285F
0x10: 0x0
0x18: 0x82B000
0x20: 0x10000
0x28: 0x2BADB00200000000
0x30: 0x0

View file

@ -21,7 +21,7 @@ pci: enabled=1, chipset=i440fx
vga: extension=vbe, update_freq=5, realtime=1
cpu: count=1, ips=4000000, model=corei7_haswell_4770, reset_on_triple_fault=1, cpuid_limit_winnt=0, ignore_bad_msrs=1, mwait_is_nop=0
print_timestamps: enabled=0
gdbstub: enabled=1, port=1234, text_base=0, data_base=0, bss_base=0
# no gdb stub
port_e9_hack: enabled=0
private_colormap: enabled=0
clock: sync=none, time0=local, rtc_sync=0