Chromebook 3 with seabios VGA question

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
ryan64128256
Posts: 6
Joined: Mon Jul 29, 2019 6:20 pm
Libera.chat IRC: ryan64128

Chromebook 3 with seabios VGA question

Post by ryan64128256 »

I’ve been trying to follow the baby steps tutorial for making a simple bootloader but i’ve Found that the VGA video RAM buffer is not located at 0xB8000 or 0xB0000, or even 0xA0000. I tried calling BIOS interrupt 0x10, AX 0x4F00 to see what video modes are supported and if I read it correctly it was only one, I think it said 0x0140. It also said the the video RAM buffer was at 0xC0000. There is data starting at this address until around 0xC0800 but nothing seems like the VGA format of two bytes (color palettes, char data). I am new at all of this but if anyone has any information on where chromebooks with seabios maintain the video RAM buffer I would greatly appreciate it. Thank you for your time

(Just to clarify I’m using a Samsung Chromebook 3 it has an intel centrino processor, I believe, with the intel hd graphics 400)
MichaelPetch
Member
Member
Posts: 712
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Chromebook 3 with seabios VGA question

Post by MichaelPetch »

You sure about video mode 0x140? Is it possible that the address was 0xc0000000 (would make sense for an Linear Frame Buffer) and not 0xc0000?
ryan64128256
Posts: 6
Joined: Mon Jul 29, 2019 6:20 pm
Libera.chat IRC: ryan64128

Re: Chromebook 3 with seabios VGA question

Post by ryan64128256 »

The address of VRAM given was given as 00 00 00 C0 so I assumed that because the processor was in real mode that it was giving me segment:offset C000:0000, I never considered it might be the linear address. I’m not sure about the video mode of 0140 because when I try and change the video mode with BIOS it only allows video mode 03. I’m a little confused by that
MichaelPetch
Member
Member
Posts: 712
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Chromebook 3 with seabios VGA question

Post by MichaelPetch »

The linear frame buffer (LFB) that is returned is "linear" by Int 10/AX=4F01h. 00 00 00 c0 would be linear address 0xc0000000. That memory is graphics memory though. I don't know anything about that device. Not sure if the text mode is actually implemented in the BIOS on that system by using graphics mode. That could explain why writing to 0xb8000:0x0000 doesn't display anything. The other possibility is that device uses a text mode page other than 0 (but that would be unusual as a default). I wonder what E820 shows as a memory map.

If the system is emulating legacy BIOS you should be able to detect the current video mode by looking at the BYTE value at linear address 0x00449. I'd be curious what it is. As for video mode 0x140, if it were correct that has been known to be 320x200x32bpp I believe. That seems like an awfully unusual resolution.
Octocontrabass
Member
Member
Posts: 5227
Joined: Mon Mar 25, 2013 7:01 pm

Re: Chromebook 3 with seabios VGA question

Post by Octocontrabass »

MichaelPetch wrote:As for video mode 0x140, if it were correct that has been known to be 320x200x32bpp I believe. That seems like an awfully unusual resolution.
That assumes it's a standard mode number, but there are no standard mode numbers in VBE 2.0.

It looks like some versions of SeaBIOS will only report mode 0x140 as supported. I think it's usually the native resolution.
ryan64128256
Posts: 6
Joined: Mon Jul 29, 2019 6:20 pm
Libera.chat IRC: ryan64128

Re: Chromebook 3 with seabios VGA question

Post by ryan64128256 »

Thank you for everyone's help with this. I will try int 15h, ax=e820h to get a clearer picture of the memory map. I will put up the results when I get them. Thanks again, I appreciate it!
ryan64128256
Posts: 6
Joined: Mon Jul 29, 2019 6:20 pm
Libera.chat IRC: ryan64128

Re: Chromebook 3 with seabios VGA question

Post by ryan64128256 »

This is what I got from int 0x15, ax=0xE820.

Chromebook 3 Memory Map

No. Base Length Type Extended Attrb.
1 0x0000000000000000 0x000000000090FC00 Usable 1
2 0x000000000009FC00 0x0000000000000400 Reserved 1
3 0x00000000000F0000 0x0000000000010000 Reserved 1
4 0x0000000000100000 0x000000001FF00000 Usable 1
5 0x0000000020000000 0x0000000000100000 Reserved 1
6 0x0000000020100000 0x000000005CB0F000 Usable 1
7 0x000000007CC0F000 0x00000000033F1000 Reserved 1
8 0x00000000E0000000 0x0000000010000000 Reserved 1
9 0x00000000FEA00000 0x0000000000200000 Reserved 1
10 0x00000000FED01000 0x0000000000001000 Reserved 1
11 0x00000000FED03000 0x0000000000001000 Reserved 1
12 0x00000000FED06000 0x0000000000001000 Reserved 1
13 0x00000000FED08000 0x0000000000001000 Reserved 1
14 0x00000000FED1C000 0x0000000000001000 Reserved 1
15 0x00000000FED40000 0x0000000000005000 Reserved 1
16 0x00000000FED80000 0x0000000000004000 Reserved 1
17 0x0000001000000000 0x0000000080000000 Usable 1

Also, I checked address 0x0449 and it was video mode 0x03. I'm still not sure how I can directly access the VRAM though...
MichaelPetch
Member
Member
Posts: 712
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Chromebook 3 with seabios VGA question

Post by MichaelPetch »

The map looks reasonably normal except for one odd thing:

1 0x0000000000000000 0x000000000090FC00 Usable 1

That makes no sense. It should have been 0x000000000009FC00. Is it a bug in your E820 parsing? print routine problem? or is that what the BIOS really reported?

Video mode 3 is 80x25 text mode. You absolutely sure that you wrote to 0xb8000 properly? Maybe there was a bug in your code? Just making sure.

Since graphics video ram (LFB) is at 0xc0000000 have you tried writing there? You would have to enter protected mode (or unreal mode) to accsss that memory. I wonder what happens if you simply attempt to fill the first 1MB of video ram with the same value. Does that fill part of the screen with the same color?
ryan64128256
Posts: 6
Joined: Mon Jul 29, 2019 6:20 pm
Libera.chat IRC: ryan64128

Re: Chromebook 3 with seabios VGA question

Post by ryan64128256 »

Hey! It worked! I entered protected mode and tried filling some of the LFB starting at 0xC0000000 with the same data as you suggested and it produced a partially filled screen with the same color. Oh and sorry that was a typo on my part, I had manually copied down the results of the BIOS 0x15, ax=0xE820 function and just put the F0 in by mistake when I typed it. So now I have the ability to write pixels to the screen does that mean I will have to write my own functions to print characters to the screen since I can't find where the text mode graphics buffer is? And I'm pretty sure I wrote to 0xb8000 correctly I double checked multiple times and retried multiple times and nothing. Thank again, this was a big help
MichaelPetch
Member
Member
Posts: 712
Joined: Fri Aug 26, 2016 1:41 pm
Libera.chat IRC: mpetch

Re: Chromebook 3 with seabios VGA question

Post by MichaelPetch »

It appears the BIOS you are using isn't typical and it is doing everything in graphics mode in the LFB. As you suggest you will have to write characters graphically on the display, but it is speculation on my part. Does the BIOS Int 10/AH=0Eh routines display text? If it does then it means the BIOS is going through the process of writing to the graphical display under the hood.

Sounds like you will have to acquire a set of fonts and write code that writes the fonts to the screen if you want to emulate text mode.
ryan64128256
Posts: 6
Joined: Mon Jul 29, 2019 6:20 pm
Libera.chat IRC: ryan64128

Re: Chromebook 3 with seabios VGA question

Post by ryan64128256 »

Yeah BIOS int 0x10 ah=0x0e does display text so I’m going to write a small library to display text. Thank you for your help again. I was stuck on this for about a month
User avatar
eekee
Member
Member
Posts: 827
Joined: Mon May 22, 2017 5:56 am
Libera.chat IRC: eekee
Location: Hyperspace
Contact:

Re: Chromebook 3 with seabios VGA question

Post by eekee »

MichaelPetch wrote:It appears the BIOS you are using isn't typical and it is doing everything in graphics mode in the LFB.
Just a note: Chromebooks aren't typical; not entirely compatible with standard PCs. SeaBIOS usually gets the blame. :) It's possible the only incompatibility is this lack of standard VGA modes.
Kaph — a modular OS intended to be easy and fun to administer and code for.
"May wisdom, fun, and the greater good shine forth in all your work." — Leo Brodie
Post Reply