guys right now I can switch graphics, I got multitasking using stack based taskswitching, I got ring3, memory management using bitmap, so, I need
to understand a thing.
this is my link.ld that I use to create my kernel.bin
OUTPUT_FORMAT("binary")
ENTRY(start)
phys = 0x00100000;
SECTIONS
{
.text phys : AT(phys) {
code = .;
*(.text)
. = ALIGN(4096);
}
.data : AT(phys + (data - code))
{
data = .;
*(.data)
. = ALIGN(4096);
}
.bss : AT(phys + (bss - code))
{
bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .;
}
now is my question:
to create a program.bin to execute at my o.s
do I have to change these line: phys = 0x00100000; to
phys = 0x00000000; ??? I cannot understand that line..
is this something like org 100 from msdos .com file ?
and that program.bin need to be started like our kernel ?
using start.asm that call main from .c source ?
please guys help me... in case anyone wants to take a look at my source I´ll be so glad to share...
help me loading binary files
Re: help me loading binary files
Yes, it is like org 100. It is the physical memory address you want to load you program.bin at. It is so because you link your file to binary format, which doesn't contain any symbolic information. You will have to load it at the address it is linked to. If however you want to load and link it dynamically you have to use a format containing symbolic information like ELF, COFF or maybe A.OUT can do the job.digo_rp wrote: now is my question:
to create a program.bin to execute at my o.s
do I have to change these line: phys = 0x00100000; to
phys = 0x00000000; ??? I cannot understand that line..
is this something like org 100 from msdos .com file ?
I suppose your kernel have to load the program.bin file into memory at the correct location, create a new process, which in fact jumps to the location and executes it. For that to work you need a disk driver and some sort of file system. As a beginning you can just include the content of program.bin in your kernel so it gets loaded in memory, and then relocate (move) it to the correct location in memory, when executing it.digo_rp wrote:and that program.bin need to be started like our kernel ?
Maybe I missed the point. If so try to reformulate your question.