Hi
Ich hab folgenden Code:
Die main-Funktion wird zwar ausgeführt, aber die Funktionen werden nicht durchgegangen...
Wo liegt der Fehler??
Kompilieren tu ich so:
Und das ist meine link.txt:
Was mache ich falsch??
Ich hab folgenden Code:
Code: [Auswählen]
#include "bootio.hpp"
#include "types.hpp"
namespace boot
{
char *VRAM = (char*)0xB8000;
//Werte
WORD _position = 0;
BYTE _color = 0x07;
//-----------------------------------------------------------------------------------
void clrscr()
{
for(int i=0; i<(80*25*2); i+=2)
{
VRAM[i ] = ' ';
VRAM[i+1] = _color;
}
_position = 0;
}
//-----------------------------------------------------------------------------------
void gotoxy(WORD x, WORD y)
{
_position = (y*25+x)*2;
}
//-----------------------------------------------------------------------------------
void setcolor(BYTE color)
{
_color = color;
}
//-----------------------------------------------------------------------------------
//-----------------------------------------------------------------------------------
void print(char *string)
{
int i=0;
do
{
VRAM[_position ] = '#';//string[i];
VRAM[_position+1] = 0xEC;//_color;
i++;
_position += 2;
}
while(string[i-1] != 0);
return;
}
}Code: [Auswählen]
#include "types.hpp"
#include "bootio.hpp"
int main()
{
char *VRAM = (char*)0xB8000;
VRAM+=4;
*VRAM = '['; //Geht
VRAM++;
*VRAM = 0xEC;
boot::gotoxy(1, 1);
boot::setcolor(0x0A | 0x80); //0x80 == Blinken
boot::print("Test"); // Text wird nicht ausgegeben
VRAM++;
*VRAM = ']'; //Geht auch
VRAM++;
*VRAM = 0xEC;
return 0;
}Die main-Funktion wird zwar ausgeführt, aber die Funktionen werden nicht durchgegangen...
Wo liegt der Fehler??
Kompilieren tu ich so:
Code: [Auswählen]
gpp -c -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o d:\reos\_ckernel\bootio.obj d:\reos\_ckernel\bootio.cpp
gpp -c -nostdlib -fno-builtin -fno-rtti -fno-exceptions -o d:\reos\_ckernel\kernelc.obj d:\reos\_ckernel\kernelc.cppUnd das ist meine link.txt:
Code: [Auswählen]
OUTPUT_FORMAT("binary")
INPUT(d:\reos\_ckernel\kernelexe.obj d:\reos\_ckernel\kernelc.obj d:\reos\_ckernel\bootio.obj)
ENTRY(start)
SECTIONS
{
.text 0x11E00 :
{
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(1);
}
.data :
{
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(1);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(1);
}
end = .; _end = .; __end = .;
}Was mache ich falsch??

Übersicht
Wiki
Hilfe
Suche
Einloggen
Registrieren
Drucken


Gespeichert