What should I do before switching to Protected or long-mode
What should I do before switching to Protected or long-mode
So far:
1. I checked the memory so I know what limits my memory-manager has.
2. I checked the bootdevice so I can define how to read from it to set-up other hardware.
Is there more main functions I should check using BIOS interrupts, because it's almost impossible in PROTECTED-MODE or LONG-MODE?
1. I checked the memory so I know what limits my memory-manager has.
2. I checked the bootdevice so I can define how to read from it to set-up other hardware.
Is there more main functions I should check using BIOS interrupts, because it's almost impossible in PROTECTED-MODE or LONG-MODE?
Computer says NOOOO
Re: What should I do before switching to Protected or long-m
You don't have to use the BIOS to scan the PCI bus, but you can do so. In any case, if you later think of something which should have gone into your real mode boot code, you can simply go back and put it in. I have a structure, containing various pieces of useful information, which I pass to the kernel. So if needed I could just add some extra fields to that, and pass any newly acquired info to the kernel.Holus wrote:So far:
1. I checked the memory so I know what limits my memory-manager has.
2. I checked the bootdevice so I can define how to read from it to set-up other hardware.
Is there more main functions I should check using BIOS interrupts, because it's almost impossible in PROTECTED-MODE or LONG-MODE?
Re: What should I do before switching to Protected or long-m
I'm the @$$ who still want to "HOPE" the bootloader is 1 stage of 0x200 bytes.Casm wrote: You don't have to use the BIOS to scan the PCI bus, but you can do so. In any case, if you later think of something which should have gone into your real mode boot code, you can simply go back and put it in. I have a structure, containing various pieces of useful information, which I pass to the kernel. So if needed I could just add some extra fields to that, and pass any newly acquired info to the kernel.
I hope it's small if i find some thing.
Scanning PCI is an already build function. But thanks for the sugestion.
Computer says NOOOO
Re: What should I do before switching to Protected or long-m
1. Enable A20
2. Get the memory map
3. Scan for a list of available fundamental devices attached to the system.
4. Switch to some high res graphics, if you need to.
5. Load the 2nd stage loader, modules or the kernel off the disk.
6. ...
The whole setup depends upon your requirement, of course.
Cheers.
2. Get the memory map
3. Scan for a list of available fundamental devices attached to the system.
4. Switch to some high res graphics, if you need to.
5. Load the 2nd stage loader, modules or the kernel off the disk.
6. ...
The whole setup depends upon your requirement, of course.
Cheers.
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
Re: What should I do before switching to Protected or long-m
Setting the graphics is a real good one!! Thanks. I try to find some information about setting a propper VESA mode but all articles set it bij INT 0x10.Chandra wrote:1. Enable A20
2. Get the memory map
3. Scan for a list of available fundamental devices attached to the system.
4. Switch to some high res graphics, if you need to.
5. Load the 2nd stage loader, modules or the kernel off the disk.
6. ...
The whole setup depends upon your requirement, of course.
Cheers.
There must be a way setting the state bij using the ports. I need it somewere in the year 2057 when someone develloped the first programm for my OS. But setting it and not changing the state is a good advise for now.
Thanks
Computer says NOOOO
Re: What should I do before switching to Protected or long-m
Does someone know how to switch banks in Pmode (no bios INT 0x10) using the IO PORTS.Chandra wrote:1. Enable A20
2. Get the memory map
3. Scan for a list of available fundamental devices attached to the system.
4. Switch to some high res graphics, if you need to.
5. Load the 2nd stage loader, modules or the kernel off the disk.
6. ...
The whole setup depends upon your requirement, of course.
Cheers.
Is it a standaard routine or is it card specific?
Computer says NOOOO
Re: What should I do before switching to Protected or long-m
The only standard that exists for video-mode switching, and that is widely adopted, is int 0x10 from real-mode / V86 mode. There was an EGA/VGA standard for doing graphics, but not even that standard defined how to switch modes with IO-instructions. It was (and still is) int 0x10 that do that.
If one don't want to have a fixed graphics resolution, there is a need to support V86-mode in order to be able to switch video-mode once the kernel is started. It's not too hard to support on newer processors that has V86 extensions.
If one don't want to have a fixed graphics resolution, there is a need to support V86-mode in order to be able to switch video-mode once the kernel is started. It's not too hard to support on newer processors that has V86 extensions.
Re: What should I do before switching to Protected or long-m
I found something very usefull ([-X )!!
Good old interupts!!!
http://www.delorie.com/djgpp/doc/rbinter/id/92/2.html
http://www.delorie.com/djgpp/doc/rbinter/id/93/2.html
But the function is not supported on my computer
So i wouldn't use it is you want me as a costumer
Good old interupts!!!
http://www.delorie.com/djgpp/doc/rbinter/id/92/2.html
http://www.delorie.com/djgpp/doc/rbinter/id/93/2.html
But the function is not supported on my computer
So i wouldn't use it is you want me as a costumer
Last edited by Holus on Sat Oct 08, 2011 12:38 pm, edited 1 time in total.
Computer says NOOOO
Re: What should I do before switching to Protected or long-m
VESA3.0 does provide the protected mode interface but it still doesn't employ the use of ports. On the other hand, bank switching is slow and troublesome so you've better just go on with the Linear Frame Buffer(VESA2.0)Holus wrote:Does someone know how to switch banks in Pmode (no bios INT 0x10) using the IO PORTS.Chandra wrote:1. Enable A20
2. Get the memory map
3. Scan for a list of available fundamental devices attached to the system.
4. Switch to some high res graphics, if you need to.
5. Load the 2nd stage loader, modules or the kernel off the disk.
6. ...
The whole setup depends upon your requirement, of course.
Cheers.
Is it a standaard routine or is it card specific?
Programming is not about using a language to solve a problem, it's about using logic to find a solution !
- DavidCooper
- Member
- Posts: 1150
- Joined: Wed Oct 27, 2010 4:53 pm
- Location: Scotland
Re: What should I do before switching to Protected or long-m
ij lijk your Dutch spellings, but whij stop at bij?Holus wrote:I try to find some information about setting a propper VESA mode but all articles set it bij INT 0x10.
There must be a way setting the state bij using the ports.
Help the people of Laos by liking - https://www.facebook.com/TheSBInitiative/?ref=py_c
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
MSB-OS: http://www.magicschoolbook.com/computing/os-project - direct machine code programming
- 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: What should I do before switching to Protected or long-m
That's nonsense. The VGA is the standard, and any device that's compatible with it can be modechanged with the same I/O instructions that work on an original VGA. What you are probably referring to are the few graphics devices from that era that tried to be a VGA wannabe and sucked at it (and therefore are by definition NOT VGA-compatible).rdos wrote:There was an EGA/VGA standard for doing graphics, but not even that standard defined how to switch modes with IO-instructions.
In fact, a VGA driver is the most effective native graphics driver to write due to the abundant information and example code, and the fact that even now practically all machines still have support for it. You just won't be able to get high resolutions or high bitdepths with it. As a nice bonus, PCI video cards will actually tell you if they are VGA compatible.
Re: What should I do before switching to Protected or long-m
Maybe I'm not capable of searching,.. Can you point me to a URL about these VESA 3.0 functions. My graphical card is VESA 3.0 (should be 2.x+ and support that function BUT NO!!!)Chandra wrote: VESA3.0 does provide the protected mode interface but it still doesn't employ the use of ports. On the other hand, bank switching is slow and troublesome so you've better just go on with the Linear Frame Buffer(VESA2.0)
Isn't it that bank-switching is slow because you use DMA and you GPU and with Linear Frame Buffer it's quick because you use your CPU? (isn't that from a time when the Graphical Cards where slow in de 80's)
I'm making an OS for a DATABASE and no full-hd moviestreamer. Isn't bank-switching better for me? (less CPU and more GPU is better for me)
Computer says NOOOO
- 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: What should I do before switching to Protected or long-m
That spec isn't too hard to find
VBE3 supports linear framebuffers just as well as VBE2 cards do. One of the key differences is that the protected mode interface has been overhauled (and therefore, often missing). Not that VBE2 cards did a good job at that either.
Therefore, everyone here that's using a 32-bit os and is sane, avoids bankswitching like the plague.
And that has nothing to do with a GPU, you need native drivers to do anything with that, and the BIOS won't do that for you.
EDIT: source got edited away. Nevertheless:
Ils are 馬鹿, diesen mensen.
VBE3 supports linear framebuffers just as well as VBE2 cards do. One of the key differences is that the protected mode interface has been overhauled (and therefore, often missing). Not that VBE2 cards did a good job at that either.
As for the linear framebuffer, the only difference is that you have limited addressing space to write your memory to, and therefore have to use port IO (which is the actual slow part) to change the video card's internal addressing, as well as having to modify your drawing functions to the framebuffer to move the window where needed, adding more checks. Also, modern framebuffers can be set to be cached, while this can't be safely done for the VGA range, making the advantage of using the LFB even greater.Holus wrote:isn't that from a time when the Graphical Cards where slow in de 80's
Therefore, everyone here that's using a 32-bit os and is sane, avoids bankswitching like the plague.
And that has nothing to do with a GPU, you need native drivers to do anything with that, and the BIOS won't do that for you.
EDIT: source got edited away. Nevertheless:
Holus wrote:LOL I speak alle Sprachen door elkaar. Heureusement, il est entendu
Ils are 馬鹿, diesen mensen.
Re: What should I do before switching to Protected or long-m
What is the best way to enable the "linear framebuffer"?Combuster wrote:VBE3 supports linear framebuffers just as well as VBE2 cards do. One of the key differences is that the protected mode interface has been overhauled (and therefore, often missing). Not that VBE2 cards did a good job at that either.
So if I anable it and look at the PCI - BAR there is no trobble with VIDEO anymore?
If I set a VIDEO mode like.
1900x1200x32bit
The computer allocates BASE ADDRESS .. BASE ADDRESS + 0x8B2900 for VIDEO memory??
I see it's taken C0000000-CFFFFFFF now.
That's a loss of 100 MB of RAM??
UUUUUUH I don't have C0000000 bytes of ram
Is this actual added DIRECT video memory????
Is there a way to disable all the memory locations I don't want to use. Unlink the DMA at A0000 for example.
Computer says NOOOO
Re: What should I do before switching to Protected or long-m
Set Bit 14 in BX when calling Int 0x10.Holus wrote:What is the best way to enable the "linear framebuffer"?
(AX=4F02H, BX=Mode No. with bit 14 set)
Not sure what you mean by that. You may want to check spellings and grammar.Holus wrote:So if I anable it and look at the PCI - BAR there is no trobble with VIDEO anymore?
Forget it. It's hardly supported by any VESA Standard.Holus wrote:If I set a VIDEO mode like.
1900x1200x32bit
C0000000 is the virtual address. Even if you have 16 Megabytes of RAM, you may still address this portion of Memory(depending on which portion of the memory is mapped for Input/Output). I recommend you get a comprehensive look at Memory Mapped Input Output.Holus wrote:I see it's taken C0000000-CFFFFFFF now.
That's a loss of 100 MB of RAM??
UUUUUUH I don't have C0000000 bytes of ram
Programming is not about using a language to solve a problem, it's about using logic to find a solution !