Wie kriege ich denn raus, welcher Code an 0x1024a3 liegt?
Debuggen algemein ist in der Betriebssystementwicklung ja generel eher schwer möglich.
Das einzige was ich sicher weiß ist noch, dass der Fehler nicht auftrit, wenn ich "Console_WriteChar" in den Multitaskthreads auskommentiere...
init.c
void Write0()
{
while(true)
{
//halt();
Console_WriteChar('0');
for(int i = 0; i < 0x6fffff; i++) nop10();
}
}
void WriteX()
{
while(true)
{
//halt();
Console_WriteChar('X');
for(int i = 0; i < 0x6fffff; i++) nop10();
}
}
void main(Multiboot_Info* MultibootInfo)
{
Time_Read(&StartTime);
Console_ClearScreen();
Console_WriteHeader("Kernel gestartet!");
Console_Write("Bootloader: ");
Console_WriteLine(MultibootInfo->BootloaderName);
Console_Write("Prozessorhersteller: ");
int Processorvendor = CpuId_ReadVendor();
Console_WriteVendor(Processorvendor);
Console_NewLine();
if (Processorvendor == CPUID_VENDOR_INTEL)
{
Console_Write("Prozessortype: ");
Console_WriteIntelProcName();
Console_NewLine();
}
Console_Write("Startzeit: ");
Console_WriteTime(&StartTime);
Console_NewLine(); Console_NewLine();
Console_WriteHeader("Lade Kernel");
Gdt_Init();
ProcessCount = 2;
Processes[0] = Process_New();
Processes[0].Threads[0] = Thread_New(Proc0Thread0Stack, THREAD_STACKSIZE, Proc0Thread0UserStack, THREAD_USERSTACKSIZE, &WriteX);
Processes[1] = Process_New();
Processes[1].Threads[0] = Thread_New(Proc1Thread0Stack, THREAD_STACKSIZE, Proc1Thread0UserStack, THREAD_USERSTACKSIZE, &Write0);
Intr_Init();
stop();
}
console.c
#define CONSOLE_LINELENGTH (80)
#define CONSOLE_LINECOUNT (25)
#define CONSOLE_CHARCOUNT (CONSOLE_LINECOUNT * CONSOLE_LINELENGTH)
#define CONSOLE_VIDEO ((uint16_t*) 0xb8000)
__attribute__((unused)) uint32_t Console_Curser = 0;
__attribute__((unused)) uint32_t Console_UsingLines = 23;
__attribute__((unused)) uint8_t Console_Format = 0x07;
__attribute__((unused)) bool Console_ShowCurser = true;
[...] //Sehr viel jetzt nicht relevanter Code
void Console_ShiftUp()
{
for(int i = 0; i < CONSOLE_CHARCOUNT; i++)
{
if (i < (CONSOLE_CHARCOUNT - CONSOLE_LINELENGTH))
{
//Untere Zeile nach oben kopieren
CONSOLE_VIDEO[i] = CONSOLE_VIDEO[i + CONSOLE_LINELENGTH];
}
else
{
//Unterste Zeile leeren
CONSOLE_VIDEO[i] = ((uint16_t)EMPTYCHAR) | (((uint16_t)Console_Format) << 8);
}
}
//Curser eine Zeile nach oben verschieben
Console_Curser -= CONSOLE_LINELENGTH;
Console_CurserMove();
}
void Console_NewLine()
{
//Zeiger platzieren
Console_Curser -= Console_Curser % CONSOLE_LINELENGTH;
Console_Curser += CONSOLE_LINELENGTH;
//Zeilen hochschieben wenn nötig
if (Console_UsingLines >= (Console_Curser * CONSOLE_LINELENGTH))
{
Console_ShiftUp();
}
}
void Console_WriteChar(const char Char)
{
//Zeiger platzieren
if (Char == NEWLINE)
{
Console_NewLine();
return;
}
//Zeilen hochschieben wenn nötig
if ((Console_Curser / CONSOLE_LINELENGTH) >= Console_UsingLines)
{
Console_ShiftUp();
}
//Zeichen schreiben
CONSOLE_VIDEO[Console_Curser++] = ((uint16_t)Char) | (((uint16_t)Console_Format) << 8);
}