Does kernel base address can't be changed
Does kernel base address can't be changed
I'm doing some work on JOS. The kernel base address is 0xF0000000 in JOS. when the value is changed, some problems will happen. I'm wondering what determine the KERNBASE value.
Re: Does kernel base address can't be changed
when translates a VA to a PA, you can get PA by using VA - KERNBASEkyowill wrote:I'm doing some work on JOS. The kernel base address is 0xF0000000 in JOS. when the value is changed, some problems will happen. I'm wondering what determine the KERNBASE value.
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: Does kernel base address can't be changed
Which JOS? I recall at least three OSes by that name, and odds are the one you mean isn't any of those three. It even appears to be used as a generic name for the student OS projects in the MIT Open Courseware Operating System Engineering course. You may need to post a link to the specific one you mean. Here are a few I found just on a quick DDG search:kyowill wrote:I'm doing some work on JOS. The kernel base address is 0xF0000000 in JOS.
Java Operating System
JamesxX's JOS
LeJOS LEGO Minstorms OS
Jeremy's OS for Arduino
Jose's Operating System
I am pretty sure that there was a mainframe OS called JOS back in the day, as well.
The whim of the primary developers, really.kyowill wrote: I'm wondering what determine the KERNBASE value.
Now, there are often good reasons for choosing a specific kernel base - for example, for a Higher Half Kernel on a 32-bit platform, it is sometimes useful to put it at 0x10000000 - giving the kernel literally half of the address space - for a number of reasons (e.g., it ensures that the OS has plenty of room; it makes the user and kernel space sizes equal; it makes it easy to find it without a separate constant; it is easy to tell if a given address is in the kernel space or user space by checking the high bit - not that it comes up a lot, but still; etc.). However, different OSes have different purposes, and OS devs will have different priorities. What might seem like a good reason in one design for one group of developers may not make sense for something and someone else.
Unless it is explained in the documentation and/or code comments somewhere, you'd need to consult with whoever designed the kernel's memory layout to get the answer for a specific OS.
As for why it is causing problems, first off, how, when (e.g., at compile time, at link time, at run time, etc), and why are you trying to change it, and what actually happens when you do? If you could post any error messages or (if necessary) screenshots of the results, it might help a great deal.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Re: Does kernel base address can't be changed
Sorry, couldn't help myself =)Schol-R-LEA wrote:0x10000000 - giving the kernel literally half of the address space
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: Does kernel base address can't be changed
OK, that was a dumbass attack on my part. That should have been 0x80000000.
Or am I still an idiot here? I mean binary 10000000000000000000000000000000 (2^31), which should indeed be 0x80000000. Dunno what made me think that would be 0x10000000, I just wasn't paying attention when I wrote it.
Or am I still an idiot here? I mean binary 10000000000000000000000000000000 (2^31), which should indeed be 0x80000000. Dunno what made me think that would be 0x10000000, I just wasn't paying attention when I wrote it.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Re: Does kernel base address can't be changed
No, I was referring to the 0x1 vs 0x8..Schol-R-LEA wrote:Or am I still an idiot here?
Re: Does kernel base address can't be changed
I still don‘t get the point why PA(physcial address) equal to VA(virtual address) - KERNBASE(0x80000000 or 0x10000000)Schol-R-LEA wrote:OK, that was a dumbass attack on my part. That should have been 0x80000000.
Or am I still an idiot here? I mean binary 10000000000000000000000000000000 (2^31), which should indeed be 0x80000000. Dunno what made me think that would be 0x10000000, I just wasn't paying attention when I wrote it.
Re: Does kernel base address can't be changed
It depends on how the kernel is loaded.kyowill wrote: I still don‘t get the point why PA(physcial address) equal to VA(virtual address) - KERNBASE(0x80000000 or 0x10000000)
If it's loaded starting from 0x0 in physical RAM while having virtual start address at KERNBASE, then indeed, subtracting KERNBASE from any kernel address will yield it's physical address in memory.
Learn to read.
Re: Does kernel base address can't be changed
if 0x0(physical address)is mapped to KERNBASE, but how do you know the mapping detail.dozniak wrote:It depends on how the kernel is loaded.kyowill wrote: I still don‘t get the point why PA(physcial address) equal to VA(virtual address) - KERNBASE(0x80000000 or 0x10000000)
If it's loaded starting from 0x0 in physical RAM while having virtual start address at KERNBASE, then indeed, subtracting KERNBASE from any kernel address will yield it's physical address in memory.
- Schol-R-LEA
- Member
- Posts: 1925
- Joined: Fri Oct 27, 2006 9:42 am
- Location: Athens, GA, USA
Re: Does kernel base address can't be changed
I know I asked this earlier, but can you please specify which OS named JOS you are referring to? A link to a repo and/or a site describing it, if possible, would also be appreciated.
Rev. First Speaker Schol-R-LEA;2 LCF ELF JAM POEE KoR KCO PPWMTF
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Ordo OS Project
Lisp programmers tend to seem very odd to outsiders, just like anyone else who has had a religious experience they can't quite explain to others.
Re: Does kernel base address can't be changed
https://pdos.csail.mit.edu/6.828/2016/Schol-R-LEA wrote:I know I asked this earlier, but can you please specify which OS named JOS you are referring to? A link to a repo and/or a site describing it, if possible, would also be appreciated.
Re: Does kernel base address can't be changed
You (JOS) made it yourself, so by definition you know it.kyowill wrote: if 0x0(physical address)is mapped to KERNBASE, but how do you know the mapping detail.
Learn to read.