bkerndev 16kb+ problem

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Martius

Re:bkerndev 16kb+ problem

Post by Martius »

I placed extern in front of them, but then you need to specify them in another file. Which isn't very usefull.

Well, thanks for the replies and ideas anyway

Off topic :P
Can you recommend any other tutorials like bkerndev?

I know how some of the bitwise operators like << and & work,
but what are &=, ^=, |= and %
Kemp

Re:bkerndev 16kb+ problem

Post by Kemp »

Most of the things that have an operator followed by equals do the operation with the argument and the original variable, for example:

a += b is the same as a = a + b

% is the modulus operator, it gets the remainder from a division, so

9 % 4 would be 1 (9 / 4 is 2 with a remainder of 1)
Tora OS

Re:bkerndev 16kb+ problem

Post by Tora OS »

Martius wrote:
Can you recommend any other tutorials like bkerndev?
OSDever has some great tutorials and documentations, and since they are back now...
Tora OS

Re:bkerndev 16kb+ problem

Post by Tora OS »

BTW...this is just because i like proving people wrong:


http://babb.sytes.net/PUB/Tora%20OS/toraos_bigk.JPG

Code: Select all

; This is the kernel's entry point.
[BITS 32]
global start
start:
    mov esp, _sys_stack     ; This points the stack to our new stack area
    jmp stublet ; Jump over the GRUB info crap

; This part MUST be 4byte aligned, so we solve that issue using 'ALIGN 4'
ALIGN 4
mboot:
    ; Multiboot macros to make a few lines later more readable
    MULTIBOOT_PAGE_ALIGN   equ 1<<0
    MULTIBOOT_MEMORY_INFO   equ 1<<1
    MULTIBOOT_AOUT_KLUDGE   equ 1<<16
    MULTIBOOT_HEADER_MAGIC   equ 0x1BADB002
    MULTIBOOT_HEADER_FLAGS   equ MULTIBOOT_PAGE_ALIGN | MULTIBOOT_MEMORY_INFO | MULTIBOOT_AOUT_KLUDGE
    MULTIBOOT_CHECKSUM   equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS)
    EXTERN code, bss, end

    ; This is the GRUB Multiboot header. A boot signature
    dd MULTIBOOT_HEADER_MAGIC
    dd MULTIBOOT_HEADER_FLAGS
    dd MULTIBOOT_CHECKSUM
    
    ; AOUT kludge - must be physical addresses. Make a note of these:
    ; The linker script fills in the data for these ones!
    dd mboot
    dd code
    dd bss
    dd end
    dd start

; This is where all the action happens
stublet:
    extern _main ; Declare that MAIN is in the C File.
    call _main   ; Call MAIN (hello? how are you? Im doing pretty good myself. Well, goodbye.)
    jmp $      ; MAIN finished. Dont know how though. 
Look fimilar? except for some changed comments?
Martius

Re:bkerndev 16kb+ problem

Post by Martius »

Thanks for the reply ;)

jmp $ ; MAIN finished. Dont know how though.
main can finish in case you forget the infinite loop in it ;)

and thanks for your proof that I'm wrong ;)

but can you try one thing more for me, use a much larger string
by including this file http://home.wanadoo.nl/frank.silvis/verylongstr.h
cause this is what stresses my GRUB

Maybe I'm just nuts. Maybe 20kb's of code will work, but many kb's of text won't. Who'll tell ...
Post Reply