f.e.:
Code: Select all
int test = 10;
void main()
{
// test is == 0, why???
}
Code: Select all
int test = 10;
void main()
{
// test is == 0, why???
}
Code: Select all
int magic=0xdeadbeef;
Code: Select all
mov esi,_code
cmp esi,_end
je .notfound
mov eax,[esi]
xor eax,0x21524110 ;; deadbeef's complement, so that you
;; don't get false hits
cmp eax,0xffffffff ;; 0xdead beef ^ 0x2152 4110 = 0xffff ffff
je .found
I use my own bootloader, but i don't know if i have forgotten something.btw. your linker script looks fine, but did your loader (which one do you use?) did its job properly ?
how can I do this?? I think the bootf02 doesn't do this, or.if you have something that wipes the BSS, are you sure it doesn't wipe *too much* data.
You found a bug after only 3 hours and were thinking about other hobbies instead? 3 hours on a real OS bug is quite fastCurufir wrote: After 3 hours of frustration, cursing the computer, questioning my memory of C programming, and wondering if stamp collecting might be a more amusing hobby
Can double on that, and all the arithmetic... forgot a +1 yesterday which caused my new paging code to NOT reserve the data section of my code as reserved (which it is) but to overwrite it with page frame tables... All of a sudden all my mutexes were zero!My advice would be to check your addresses.
Code: Select all
section .bss
align 4
end_of_stack:
resd 1024 ;; a 4Kb stack might be enough ??
top_of_stack:
dd halt_instruction
section .code
halt_instruction:
cli
hlt
_start:
mov esp, top_of_stack
;; other stuff