How in the world do you set up a GUI??
How in the world do you set up a GUI??
Hi, again. So I've fixed all the problems in my kernel. So now I'm wondering, how on earth do you change the vbe mode or something?
I've googled so much, but nothing. I know there is a patch that makes grub actually use the vbe flag, but I can't find the 0.97 source anywhere. I know I should switch to real mode to change modes, but how would I do that?
Also, don't ask me to use GRUB 2; It is over-complicated. Unless of course, someone would be kind enough to provide me with a set of commands that actually make a bootable ISO file. (Qemu complains about no bootable media).
I've googled so much, but nothing. I know there is a patch that makes grub actually use the vbe flag, but I can't find the 0.97 source anywhere. I know I should switch to real mode to change modes, but how would I do that?
Also, don't ask me to use GRUB 2; It is over-complicated. Unless of course, someone would be kind enough to provide me with a set of commands that actually make a bootable ISO file. (Qemu complains about no bootable media).
[nx] kernel: http://github.com/zhiayang/nx
Re: How in the world do you set up a GUI??
I couldn't get Grub 0.97 to do VBE. I tried patching it and rebuilding it and even tried to debug it a little but in the end I gave up.
I wrote a small asm function that drops back to real mode and does an int10 then returns to protected mode and copies the data to a C buffer. I only use it in my loader before the OS is actually loaded to set a graphics mode.
There is a wiki article on how to switch to real mode but I didn't try that. It looks correct though http://wiki.osdev.org/Real_mode#Switchi ... _Real_Mode
I wrote a small asm function that drops back to real mode and does an int10 then returns to protected mode and copies the data to a C buffer. I only use it in my loader before the OS is actually loaded to set a graphics mode.
There is a wiki article on how to switch to real mode but I didn't try that. It looks correct though http://wiki.osdev.org/Real_mode#Switchi ... _Real_Mode
If a trainstation is where trains stop, what is a workstation ?
Re: How in the world do you set up a GUI??
For example long->real (bios int)->long: http://forum.osdev.org/viewtopic.php?f=1&t=23125requimrar wrote:I know I should switch to real mode to change modes, but how would I do that?
Learn to search. There are many examples for protmode too, also for creating iso files on the wiki.
Actualy I wonder how on earth could you write an OS, if creating an iso image is too complicated for you.
Re: How in the world do you set up a GUI??
I can make an iso image. I know how to read tutorials. BUT: All those grub2 isos I made refuse to boot anywhere.turdus wrote:
Actualy I wonder how on earth could you write an OS, if creating an iso image is too complicated for you.
[nx] kernel: http://github.com/zhiayang/nx
Re: How in the world do you set up a GUI??
alias making="making successfully"requimrar wrote:I can make an iso image. [...] All those grub2 isos I made refuse to boot anywhere.
Every good solution is obvious once you've found it.
Re: How in the world do you set up a GUI??
... Okay then. Either way, I was just curious. Maybe when I get to that stage grub 2.0 will remove this lame crap.Solar wrote:alias making="making successfully"requimrar wrote:I can make an iso image. [...] All those grub2 isos I made refuse to boot anywhere.
[nx] kernel: http://github.com/zhiayang/nx
Re: How in the world do you set up a GUI??
I wouldn't hold my breath for the GRUB maintainers putting much of an effort into "fixing" VBE handling. GRUB is mainly a bootloader for mainstream operating systems, and those come with their own GFX driver architecture...
Every good solution is obvious once you've found it.
Re: How in the world do you set up a GUI??
You wouldn't want to use GRUB to change video-mode, simply because you want to be able run your OS without GRUB. GRUB is a bootloader, not a video-BIOS.
The easiest way to change video mode is while you are still in real-mode. Then you can just issue the appropriate calls and it would work unless the BIOS is broken. The best way is to be able to do it at any time, but that requires a pretty good V86 environment. That is not the first thing you want to do.
The easiest way to change video mode is while you are still in real-mode. Then you can just issue the appropriate calls and it would work unless the BIOS is broken. The best way is to be able to do it at any time, but that requires a pretty good V86 environment. That is not the first thing you want to do.
Re: How in the world do you set up a GUI??
Not sure why GrUB doesn't support it... being able to tell the bootloader what video mode you want is defined by the multiboot standard. Does GrUB not implement proper support for it anymore?
In any case, I do agree with rdos - having the bootloader switch video modes creates a dependency between your OS and a specific boot loader and effectively makes it impossible to switch video modes later on. Options include real/v86 modes with VBE or Video BIOS, writing your own SVGA+ drivers, or writing a VGA-compliant driver.
Also, GUI != video driver or graphics API. You need both (of sorts) before being able to set up a GUI.
In any case, I do agree with rdos - having the bootloader switch video modes creates a dependency between your OS and a specific boot loader and effectively makes it impossible to switch video modes later on. Options include real/v86 modes with VBE or Video BIOS, writing your own SVGA+ drivers, or writing a VGA-compliant driver.
Also, GUI != video driver or graphics API. You need both (of sorts) before being able to set up a GUI.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
Re: How in the world do you set up a GUI??
requimrar wrote:I know I should switch to real mode to change modes, but how would I do that?
How in the hell did you get into protected mode then.
Re: How in the world do you set up a GUI??
The OP didn't. Grub did it for him.GhostXoPCorp wrote:How in the hell did you get into protected mode then.requimrar wrote:I know I should switch to real mode to change modes, but how would I do that?
Re: How in the world do you set up a GUI??
Yeah, the downside of too powerful tools. You don't know how you ended up in protected mode, and you don't know how to exit protected mode, and may not even know what protected mode actually is since GRUB allows you to write your code in C.quok wrote:The OP didn't. Grub did it for him.GhostXoPCorp wrote:How in the hell did you get into protected mode then.requimrar wrote:I know I should switch to real mode to change modes, but how would I do that?
- piranha
- Member
- Posts: 1391
- Joined: Thu Dec 21, 2006 7:42 pm
- Location: Unknown. Momentum is pretty certain, however.
- Contact:
Re: How in the world do you set up a GUI??
Read: I hate C. Everyone should code in assembly. *cough*theOPsignoranceastowhatprotectedmodeishasnothingtodowithhisusingC,butmoretodowithhislackofresearchandknowledge*cough*rdos wrote: Yeah, the downside of too powerful tools. You don't know how you ended up in protected mode, and you don't know how to exit protected mode, and may not even know what protected mode actually is since GRUB allows you to write your code in C.
Patching grub to switch modes for you isn't that difficult, I got it working pretty quickly. Other than that, if you're using bochs or Qemu you can write a really simple driver that allows you to switch modes...
All that said, if you don't know how to switch to and from protected mode you should focus on the basics before switching to graphics mode...
-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
Re: How in the world do you set up a GUI??
Well, I was looking for an easy way to change the video mode. On wiki there's a list of possible ways of doing it, and it's in order of dificulty. Because I'm using GRUB, interrupts won't do. So I decided to search how to patch Grub, and I've found a pre-built patched GRUB on this topic.
I downloaded the stage2_eltorito, replaced it, and changed my menu.lst file. All I did was actually to add a line after the kernel command:
Where XXX is the hex value related to the mode you want. To find out which value to put, I just pressed C to enter grub's command line, and typed the command:
It worked for me at least. Anyway, I don't think this is really useful. I still think it's better to study and try to code my own vga driver.
I downloaded the stage2_eltorito, replaced it, and changed my menu.lst file. All I did was actually to add a line after the kernel command:
Code: Select all
vbeset XXX
Code: Select all
vbeprobe
Re: How in the world do you set up a GUI??
That's not the fault of the software, its the programmer(s). Processor modes are very well documented in the specifications. By not understanding the architecture, the programmer is limited in understanding of the software.Yeah, the downside of too powerful tools. You don't know how you ended up in protected mode, and you don't know how to exit protected mode, and may not even know what protected mode actually is since GRUB allows you to write your code in C.
OS Development Series | Wiki | os | ncc
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}
char c[2]={"\x90\xC3"};int main(){void(*f)()=(void(__cdecl*)(void))(void*)&c;f();}