Missing pointers
Posted: Thu Apr 01, 2004 8:20 am
Hi,
im trying to follow the XOSDev2 tutorial but im having trouble because my pointers arent working properly! I think ive probably got something messed up in boot loader / linker.
This is in my boot loader, it apparently changes where the stack pointer is.
Should that stack pointer point to the same place as a location in my linker script?
Here is my linker script:
If its not that, can you give me any other hints as to why this piece of code just isnt working:
Any help is much appreciated.
Thanks!
(Ive attached my project files so you can take a look at the boot loader, kernel starter and kernel main)
[attachment deleted by admin]
im trying to follow the XOSDev2 tutorial but im having trouble because my pointers arent working properly! I think ive probably got something messed up in boot loader / linker.
This is in my boot loader, it apparently changes where the stack pointer is.
[BITS 32] ; We now need 32-bit instructions
clear_pipe:
mov ax, 10h ; Save data segment identifyer
mov ds, ax ; Move a valid data segment into the data segment register
mov ss, ax ; Move a valid data segment into the stack segment register
mov esp, 090000h ; Move the stack pointer to 090000h
jmp 08h:01000h ; Jump to section 08h (code), offset 01000h
; Where the kernel is located in memory
Should that stack pointer point to the same place as a location in my linker script?
Here is my linker script:
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 : {
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data : {
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
If its not that, can you give me any other hints as to why this piece of code just isnt working:
But, this piece of code does work:char *text_video = (char*)0xB8000;
char attrib = 0x07;
char *str="Kernel Loaded";
while(*str!=0)
{
*text_video = *str;
*text_video++;
*text_video = attrib;
*text_video++;
*str++;
}
*text_video = 'H';
*text_video++;
*text_video = 0x08;
*text_video++;
*text_video = 'e';
*text_video++;
*text_video = 0x08;
*text_video++;
*text_video = 'l';
*text_video++;
*text_video = 0x08;
*text_video++;
*text_video = 'l';
*text_video++;
*text_video = 0x08;
*text_video++;
*text_video = 'o';
*text_video++;
*text_video = 0x08;
*text_video++;
Any help is much appreciated.
Thanks!
(Ive attached my project files so you can take a look at the boot loader, kernel starter and kernel main)
[attachment deleted by admin]