Ich habe meinen Kernel mal kompiliert und unter Bochs ausgeführt. Aus irgend einem Grund findet ein ständiger Zugriff auf das Floppylaufwerk vor, und der Prozessor wird auch ständig belastet. Hat jemand eine Idee woran das liegen könnte?
Kann auch gerne mal meinen quelltext posten
dsplib.lib:
display.h:
kernel.c
start.asm
Hier noch mein Linkerscript:
Ich ahb absolut keine Ahnung, woran das liegen könnte.
Kann auch gerne mal meinen quelltext posten
dsplib.lib:
Code: [Auswählen]
// Bildschirmdefinition
#define DISPLAY_MEM_START 0xb8000
#define DISPLAY_MEM_END 0xB8FA0
// Konsolendefinition
#define LINE (console_y * 0xA0)
/* Konsolenzeile */
int console_y = 0;
int console_x = 0;
char* video = (char*) 0xb8000;
/* Konsolenzeile ende */
int strlng(char* string)
{
int count = 0;
while(*string)
{
string++;
count++;
}
return count;
}
void cls(void)
{
for(video=(char*)DISPLAY_MEM_START; video < (char*) DISPLAY_MEM_END;video++)
*video=0;
video = (char*) 0xb8000;
}
void s_line_print(char text[])
{
int cursor = 0;
for(cursor = 0; cursor < strlng(text);cursor++)
{
video[LINE+(2*cursor)] = text[cursor];
video[LINE+(2*cursor)+1] = 0x7;
}
console_y++;
}
void put_char(char c, int color)
{
if(c != '\n' && c != '\r' && console_x <= 80)
{
video[LINE + (2*console_x)] = c;
video[LINE + (2*console_x)+1] = color;
console_x++;
}
else
{
if(c == '\n' || console_x > 80)
{
console_y++;
return;
}
if(c == '\r')
{
console_x = 0;
return;
}
}
}
void print(char text[],int color)
{
int count;
for(count = 0; count < strlng(text);count++)
{
put_char((char) text[count],(int) color);
}
}
display.h:
Code: [Auswählen]
// Funktiondeklaration
int strlng(char* text);
void cls(void);
void s_line_print(char text[]);
void put_char(char c,int color);
void print(char text[], int color);
kernel.c
Code: [Auswählen]
#include "display.h"
void init(void)
{
cls();
s_line_print("InfoOS");
print("Starting InfoOS...\n\rPlease wait...",7);
return;
}
start.asm
Code: [Auswählen]
global loader
MB_MAGIC equ 0x1badb002
MB_FLAGS equ 0x0
MB_CHECKSUM equ - (MB_MAGIC + MB_FLAGS)
section multiboot
; Multiboot Header
align 4
dd MB_MAGIC
dd MB_FLAGS
dd MB_CHECKSUM
section .text
extern init
loader:
mov esp, 0x200000
push eax
push ebx
call init
cli ; Vorzeitige Lösung
hlt ; --
Hier noch mein Linkerscript:
Code: [Auswählen]
ENTRY (loader)
OUTPUT_FORMAT(elf32-i386)
OUTPUT_ARCH(i386:i386)
SECTIONS
{
. = 0x100000;
.text :
{
build/start.o(multiboot)
*(.text)
}
.data :
{
*(.data)
}
.bss :
{
_sbss = .;
*(COMMON)
*(.bss)
_ebss = .;
}
}
Hoffe das Hilft weiter
Ich ahb absolut keine Ahnung, woran das liegen könnte.
Übersicht
Wiki
Hilfe
Suche
Einloggen
Registrieren
Drucken


Gespeichert