flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > Help: Loading Stage Two Bootloader From Stage One Bootloader |
Author |
|
SeproMan 01 Apr 2012, 12:56
Take a look at the bootloader at the end of this post. It's just what you need!
http://board.flatassembler.net/topic.php?t=11748 _________________ Real Address Mode. |
|||
01 Apr 2012, 12:56 |
|
uautkarsh 01 Apr 2012, 17:18
Ok.. I will try to understand the code.. Thanks a lot..
Tell me one more thing.. Suppose my kernel is in C.. Then how should i compile it so that the Bootloader(you have given the link for) may load it.. |
|||
01 Apr 2012, 17:18 |
|
xleelz 01 Apr 2012, 18:27
Note: Some thinking required...
http://wiki.osdev.org/Bare_Bones |
|||
01 Apr 2012, 18:27 |
|
uautkarsh 02 Apr 2012, 17:49
@xleelz: Thanks a lot.. I dinn see that..
|
|||
02 Apr 2012, 17:49 |
|
ACP 03 Apr 2012, 08:41
uautkarsh wrote:
That really depends on what you want to achieve and how much work you would like to invest into it. You can compile it as MZ,PE or ELF file for example assuming you will include appropriate process loader into second stage bootloader. The other option is to make it raw binary and load it into predefined address space and just jump to correct entry point. The decision should also be based on your architectural decision like: when do you enable memory management, do you use protected mode or long mode etc and on which system booting stage you enable those CPU/system features. |
|||
03 Apr 2012, 08:41 |
|
uautkarsh 03 Apr 2012, 14:59
Ok.. I haven't thought of this much..
Anyways.. In my second Bootloader i will go into the protected mode.. I will try all the above suggestions.. Thanks a lot.. |
|||
03 Apr 2012, 14:59 |
|
flash 05 Apr 2012, 14:56
Or you can use GRUB, jejeje. This is a basic template for a multiboot compilant binary code:
Code: bits 32 MULTIBOOT_HEADER_MAGIC equ 0x1BADB002 MULTIBOOT_HEADER_FLAGS equ 0x00010000 CHECKSUM equ -(MULTIBOOT_HEADER_MAGIC + MULTIBOOT_HEADER_FLAGS) LOADBASE equ 0x00100000 ; the load base address org LOADBASE jmp multiboot_entry align 4 multiboot_header: dd MULTIBOOT_HEADER_MAGIC dd MULTIBOOT_HEADER_FLAGS dd CHECKSUM dd multiboot_header dd LOADBASE dd 0 dd 0 dd multiboot_entry multiboot_entry: ; as much code as the file system support |
|||
05 Apr 2012, 14:56 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.