I had an idea, since realmode does not have protection that you would see in protected mode, i have decided to plan an API wrapped around my own way of protection. Now this does not mean that it would still be protected but in a case that the kernel does get corrupted by some program, has anyone tried having another kernel in memory? Where an interrupt is fired (that CS:IP recorded) jumping to another segment at the last IP? for example
0x1000:IP -> error, do jmp far 0x2000:IP ? In case of being corrupted (not a software error)
The idea being, having another copy in memory in case of corruption?
Realmode Kernel failsafe
-
- Member
- Posts: 255
- Joined: Tue Jun 15, 2010 9:27 am
- Location: Flyover State, United States
- Contact:
Re: Realmode Kernel failsafe
If some program corrupts the kernel, what's to say that the other kernel in memory hasn't been corrupted as well?
- Kazinsal
- Member
- Posts: 559
- Joined: Wed Jul 13, 2011 7:38 pm
- Libera.chat IRC: Kazinsal
- Location: Vancouver
- Contact:
Re: Realmode Kernel failsafe
And what if that kernel copy gets totally wrecked? And how does the first kernel know how to redirect to the second? How do you plan on maintaining the same variable data in both kernels?
Keep in mind that if a program in real mode can trash whatever it pleases, whenever it pleases.
Keep in mind that if a program in real mode can trash whatever it pleases, whenever it pleases.
Re: Realmode Kernel failsafe
A shared pool would be stored after the second kernel.Blacklight wrote:How do you plan on maintaining the same variable data in both kernels?
Duh.Blacklight wrote:Keep in mind that if a program in real mode can trash whatever it pleases, whenever it pleases.
"Keep in mind that if a program is executing in real mode, it can trash whatever whenever it pleases."
Is probably what you mean't.
This in case another program has been loaded right above the kernel, And has placed its stack at the beginning of the program.Tosi wrote:If some program corrupts the kernel, what's to say that the other kernel in memory hasn't been corrupted as well?
|Kernel| |Program_Stack, Program| say for example the program has pushed too many variables to the stack, and heads on into the kernel.
Also note, this kernel multitasks. Say during the kernels operation it hits an invalid opcode (from the stack of the program in front of it) that interrupt then transfers control to the second kernel, at the end of memory. What is everyone's opinion on that?
Edit: Nevermind, there are too many problems that would occur during transfer of kernels. This would be a bad idea.
Re: Realmode Kernel failsafe
Yes - ARM's TrustZone system does just this.has anyone tried having another kernel in memory?
- Combuster
- Member
- Posts: 9301
- Joined: Wed Oct 18, 2006 3:45 am
- Libera.chat IRC: [com]buster
- Location: On the balcony, where I can actually keep 1½m distance
- Contact:
Re: Realmode Kernel failsafe
And on x86 (and many other systems for that matter), an if(assertion_failed) reboot(); is generally a very effective way to get a known good kernel into memory