Should I overwrite the IVT and relocate the BDA?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
shedokan
Posts: 22
Joined: Sat Jan 08, 2011 9:42 am

Should I overwrite the IVT and relocate the BDA?

Post by shedokan »

Hi,
I was reading about BDA having valuable information and that I shouldn't overwrite it.
So I was thinking maybe it would be better to just relocate it to someplace(possibly a page that would be moved on disk).

And I also was thinking to overwrite the IVT since I am not going back to real mode anyways.

So are there any cons for overwriting the IVT or relocating the BDA?

Thanks
User avatar
Karlosoft
Member
Member
Posts: 277
Joined: Thu Feb 14, 2008 10:46 am
Location: Italy
Contact:

Re: Should I overwrite the IVT and relocate the BDA?

Post by Karlosoft »

Only if you are in real mode. However there are some information that should't be erased, because in the future you could have to return in real mode in some way.
shedokan
Posts: 22
Joined: Sat Jan 08, 2011 9:42 am

Re: Should I overwrite the IVT and relocate the BDA?

Post by shedokan »

Karlosoft wrote:Only if you are in real mode. However there are some information that should't be erased, because in the future you could have to return in real mode in some way.
Well except for changing VGA mode I don't really think there is a reason to return to real mode(and for that too I can write a vga driver)

But what I am asking is - will there be side affects of doing this?
Tosi
Member
Member
Posts: 255
Joined: Tue Jun 15, 2010 9:27 am
Location: Flyover State, United States
Contact:

Re: Should I overwrite the IVT and relocate the BDA?

Post by Tosi »

If you stay in protected mode, there shouldn't be any side effects at all. But if you ever have any desire to use V86 mode, you should leave the BDA and IVT untouched.
shedokan
Posts: 22
Joined: Sat Jan 08, 2011 9:42 am

Re: Should I overwrite the IVT and relocate the BDA?

Post by shedokan »

Tosi wrote:If you stay in protected mode, there shouldn't be any side effects at all. But if you ever have any desire to use V86 mode, you should leave the BDA and IVT untouched.
Thanks, I thought it was much complicated than that.
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Should I overwrite the IVT and relocate the BDA?

Post by Chandra »

shedokan wrote:
Tosi wrote:If you stay in protected mode, there shouldn't be any side effects at all. But if you ever have any desire to use V86 mode, you should leave the BDA and IVT untouched.
Thanks, I thought it was much complicated than that.
"I have the word 'Complicated' ".(Just kidding)
Anyway, I don't see any reason to overwrite the BDA and the IVT even if you don't use them in the future.What is so annoying about just saving them? They don't even cost you any reasonable amount of memory.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
shedokan
Posts: 22
Joined: Sat Jan 08, 2011 9:42 am

Re: Should I overwrite the IVT and relocate the BDA?

Post by shedokan »

Chandra wrote:
shedokan wrote:
Tosi wrote:If you stay in protected mode, there shouldn't be any side effects at all. But if you ever have any desire to use V86 mode, you should leave the BDA and IVT untouched.
Thanks, I thought it was much complicated than that.
"I have the word 'Complicated' ".(Just kidding)
Anyway, I don't see any reason to overwrite the BDA and the IVT even if you don't use them in the future.What is so annoying about just saving them? They don't even cost you any reasonable amount of memory.
I just want to have my system on 0:0 :)
that way everything's organized, it's not fair letting something I'm not going to use(or rarely) be on the memory before my kernel.

if the kernel is in control it should be placed at 0:0
User avatar
Chandra
Member
Member
Posts: 487
Joined: Sat Jul 17, 2010 12:45 am

Re: Should I overwrite the IVT and relocate the BDA?

Post by Chandra »

Shedokan wrote: if the kernel is in control it should be placed at 0:0
Bad Idea. If your kernel grows in size significantly, then it'll write over the VRAM and you end up with a BROKEN OS.
A neatly written OS always organizes things so it's always best to load your kernel at 1Mb mark and leave the data below it untouched. You can then use paging to remap it to some higher addresses.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Post Reply