building OS from scratch (HELP ME .......)
Re:building OS from scratch (HELP ME .......)
hello everyone there,
i 've been trying to load the kernel with different virtual addreses .
but not at all succeeding.i think i've tried a lot of research and also
continuing with it. i'm finding it very difficult.
seeking for help . . . . . .
i 've been trying to load the kernel with different virtual addreses .
but not at all succeeding.i think i've tried a lot of research and also
continuing with it. i'm finding it very difficult.
seeking for help . . . . . .
Re:building OS from scratch (HELP ME .......)
OK, what have you tried? Why do you think it is failing? What do you intend to try to make it work?
Re:building OS from scratch (HELP ME .......)
You can, but only when using paging (which the multiboot standard doesn't support, as you know). There is no execution format that can link to a nonphysical address and resolve that with solely segmentation (unless you want to resort to your old tricks, which have proven that they are very complex and unreliable to me).Tim Robinson wrote: I don't think you can when using ELF. I think you've got to keep your virtual address within the range of physical memory. Can any ELF experts confirm or deny this?
As for the physical/virtual thingy, ELF does let you insert both a virtual and a physical value in the header, for the applications where it does matter where it's loaded. Just don't think grub is gonna like it.
Re:building OS from scratch (HELP ME .......)
grub does the correct stuff. It cares about the physical adress given to the linker.
one has to do some adress corrections to get the stuff running prior to activating paging because of the virtual adresses in the program (kernel)
one has to do some adress corrections to get the stuff running prior to activating paging because of the virtual adresses in the program (kernel)
Re:building OS from scratch (HELP ME .......)
Linkers don't use physical addresses, ever. They only know the virtual addresses.BI lazy wrote: grub does the correct stuff. It cares about the physical adress given to the linker.
one has to do some adress corrections to get the stuff running prior to activating paging because of the virtual adresses in the program (kernel)
As for the point you are making, you could also make a kernel-starter bit of code that sets up paging, resolving the entire boot to final conversion you use.
Re:building OS from scratch (HELP ME .......)
how can i set up paging ?
plz explain. . . . . . . . .
plz explain. . . . . . . . .
Re:building OS from scratch (HELP ME .......)
neuRopac: Go to http://www.osdever.net/tutorials.php?cat=6&sort=1. Read all the tutorials there. If, after you have read and attempted to understand them, you still have questions, then please come back here and ask. But do make an effort to learn for yourself before asking for help.
Re:building OS from scratch (HELP ME .......)
@candy: hmmm ... and what's that phys= ... in the linker script good for then? *frowning slightly*
Well, your point about a kernel-starter bit of code: I didn't say that I ever omitted this one. You *need* a kernel starter bit of asm to get the machine running properly and to set up some crucial prerequisites like some pagetables and a pagedirectory, but whom I am talking to? You seem to know your stuff.
Well, your point about a kernel-starter bit of code: I didn't say that I ever omitted this one. You *need* a kernel starter bit of asm to get the machine running properly and to set up some crucial prerequisites like some pagetables and a pagedirectory, but whom I am talking to? You seem to know your stuff.
Re:building OS from scratch (HELP ME .......)
Thx for the complimentBI lazy wrote: @candy: hmmm ... and what's that phys= ... in the linker script good for then? *frowning slightly*
As for actually using them, they don't. All a physical address is at link time is a future reference, something that is of interest, belongs with the program, but is completely not useful now. The linker puts together the program with all respect for the virtual addresses, but no respect for the physical addresses, since they are to be separated from him using paging or the like. There are only two possible ways it could insert it into the end file:
1. It simply forwards it to the header. As with ELF headers, they support this, so it would be useful to have a passthrough to the header, but not for use.
2. As addition to the previous, with fixed physical addresses it might be able to detect overlapping sections, but I doubt any linker does this (since it only has extremely limited practical application).
- Pype.Clicker
- Member
- Posts: 5964
- Joined: Wed Oct 18, 2006 2:31 am
- Location: In a galaxy, far, far away
- Contact:
Re:building OS from scratch (HELP ME .......)
Out of the ELF documentation:Tim Robinson wrote:I don't think you can when using ELF. I think you've got to keep your virtual address within the range of physical memory. Can any ELF experts confirm or deny this?Pype.Clicker wrote:So how do we define the virtual address that GRUB should use ?
So it looks like most loader ignore the 'physical address' stuff... I'm not sure on how GRUB's loader actually handles it, thoughp_paddr :
On systems for which physical addressing is relevant, this member is reserved for the segment's physical address. Because System V ignores physical addressing for application programs, this member has unspecified contents for executable files and sharedobjects.