flat assembler
Message board for the users of flat assembler.
Index
> OS Construction > How does Linux set it's high res text mode? Goto page 1, 2 Next |
Author |
|
Tyler 05 May 2010, 04:59
I'm looking for something a little more high res than 80x25, I've tried VBE modes 108h-10ch, they didn't work(I'm debugging with VMware).
|
|||
05 May 2010, 04:59 |
|
baldr 05 May 2010, 09:28
Tyler,
Can you set up VBE mode under VMware (e.g. from custom boot sector) without Linux? |
|||
05 May 2010, 09:28 |
|
Tyler 06 May 2010, 00:25
Does VMware even support VESA, I get an error from DexOS?
DexOS wrote:
I don't see how it can run modern OSes w/o supporting VESA. Just a note but, WinXP(in VMware) runs fine at my monitors native resolution of 1366x768. That would require VESA wouldn't it? Are there any good alternatives to VESA that are more likely to work, all I want is a text mode bigger than 80x25? I wrote:
Sorry, I just reread that and noticed how arrogant it sounds, it was completely unintended. |
|||
06 May 2010, 00:25 |
|
baldr 06 May 2010, 00:47
Tyler,
I've tried VMware Workstation 7.0.1, it appears to support only graphic modes (I've used X-VESA tool from INFOVBE, VBEMP x86 Project and cross-checked with ASTRA from Sysinfo Lab). The same picture under Bochs: only graphic modes. Bad luck. Real firmware (ATI Radeon 9550) tells that it supports three text modes (109h 132*25, 10Ah 132*43 and 130h 132*44!?). By the way, since VBE 2.0 mode numbers aren't fixed (though standard highly recommends to continue old mode numbers' support for compatibility with legacy software). |
|||
06 May 2010, 00:47 |
|
bitshifter 06 May 2010, 02:57
Tyler wrote: I don't see how it can run modern OSes w/o supporting VESA. Modern OS'es only use VESA during BIOS-BOOT. Once OS is loaded, it then loads the appropriate driver for your card. Modern OS'es have a big collection of vidcard drivers. If a driver is not found the OS might use VGA/VESA as last resort... _________________ Coding a 3D game engine with fasm is like trying to eat an elephant, you just have to keep focused and take it one 'byte' at a time. |
|||
06 May 2010, 02:57 |
|
roboman 06 May 2010, 03:06
Tyler wrote: I'm looking for something a little more high res than 80x25, I've tried VBE modes 108h-10ch, they didn't work(I'm debugging with VMware)Does VMware even support VESA, I get an error from DexOS? since you brought up DexOS, the standard text mode it runs in is 80x50. You start the 80x25 mode then reset the text from 16 bits high to 8. You might want to have the 8 bit char's in memory, since some video cards may not have an 8 bit high char set. DexOS seems a reasonably good example of how that is done. Only about half my video cards support the vesa text modes, that's the main reason for my loss of interest in cleaning up the vesa ide for dexos |
|||
06 May 2010, 03:06 |
|
Dex4u 06 May 2010, 18:14
Tyler wrote: Does VMware even support VESA, I get an error from DexOS? This is because emulator have started not to support vesa mode 640x480 32bpp And thats what the default gui menu is set to in DexOS, if you type win in the command line you will get the xp like GUI that is set to 800x600 32bpp which is now the lowest these emulators go (for vesa graphic mode). In the new ver the default is set to 800x600 so will not be a problem in emulaors. |
|||
06 May 2010, 18:14 |
|
Coddy41 09 May 2010, 17:32
Here is how to set a higher res text mode using VGA.
http://files.osdev.org/mirrors/geezer/software/90x60.asm It sets higher (90x60) this method should work in real and p-mode... Of course you could use the BIOS, but this would work with p-mode and more resiusions. Is this is what your looking for? It is probably about how linux does it. _________________ Want hosting for free for your asm project? You can PM me. (*.fasm4u.net) |
|||
09 May 2010, 17:32 |
|
Tyler 09 May 2010, 19:10
Coddy41 wrote:
You act like I know what I'm doing, . But yeah, if that isn't how Linux does it, I don't care, it's good enough for me. How can I set the font and mode 3(80x25) in pmode? I'd do it in my real mode boot loader, but I'm trying to replace my boot loader with Grub2 to make my OS multiboot compliant. |
|||
09 May 2010, 19:10 |
|
Coddy41 10 May 2010, 00:25
I think you will find what you need here: http://wiki.osdev.org/VGA_Hardware
It explains how to operate the VGA decently... |
|||
10 May 2010, 00:25 |
|
cod3b453 13 May 2010, 16:23
The VESA info function (0x4F00) returns a structure at di with a pointer (seg:off) to a list of the available video modes until you reach 0xFFFF. If you then do a get info on them (0x4F01) you can determine the type (text/graphic) and sizes using another structure at di to automatically find the highest supported mode.
|
|||
13 May 2010, 16:23 |
|
Tyler 14 May 2010, 09:34
Before I spent the time to do that, I tried setting all the Vesa test modes I was interested in(one at a time, of coarse), and this thread was started because every one I tried didn't work. I tried every "standard" Vesa text mode(I used the list at http://davmac.org/davpage/vesa.html#detect).
|
|||
14 May 2010, 09:34 |
|
sinsi 14 May 2010, 09:45
http://www.japheth.de/
Look for SETMXX Quote:
Tested booting from a floppy into dos5 on my 8800GT, no worries. The only one that looked strange was 80x60, too squashed. All modes were pretty slow though (using dos) but the bios handled everything ok. |
|||
14 May 2010, 09:45 |
|
Tyler 14 May 2010, 10:00
Aren't those graphics modes(except for the 80x60, I think that's part of setting the 90x60 Coddy41 mentioned, and the 80x34 has 14 pixel font, not much better than 16)? I need a text mode so I can print text in pmode. I REALLY want to avoid writing a font driver to use in a graphics mode for now.
I think y'all have figured out all Linux's commonly used modes, when installing it allows you to choose between 8, 14(80x34 sinsi listed), and 16 pixel font, all of which have been mentioned. Thanks for your help. |
|||
14 May 2010, 10:00 |
|
edfed 14 May 2010, 10:21
at least, did you really test to set theses modes and use them?
cause, we can speak about setting vesa text modes a very long time before to do anything.... not only setting mode is needed, you need: 1/ set vesa mode 2/ get vesa mode datas 3/ switch protected mode 4/ set a segment descriptor to vesa frame buffer 5/ use this segment to write in the frame buffer 6/ test and fix bugs otherwise, you can use a still existing font driver for vesa graphix modes. for the mode 3, you don't have to set it in pmode, because at boot time, it is already set. and if you want to set it, use real mode, or VGA I/O ports... |
|||
14 May 2010, 10:21 |
|
Tyler 15 May 2010, 01:47
edfed wrote:
Huh? Why do all that, can't I just print to the screen w/o all that, it seems to be working fine. Framebuffer... sounds scary. |
|||
15 May 2010, 01:47 |
|
edfed 15 May 2010, 08:57
of course not, it is not scary.
i explain why use a segment desciptor for the frame buffer: use a different segment than flat linear one, let you play with pixel position from 0 to maximum. no need to add frame buffer offset to every pixel operations. it is like mov es,[0A000h], and write pixel with mov byte[es:di],color limit will be set to the maximum bytes in frame buffer > memory protection. let you play transparently with a different memory than frame buffer, and then, redirect pixels writes to another routine... |
|||
15 May 2010, 08:57 |
|
Tyler 15 May 2010, 09:41
The different segment thing makes sense now, I just never thought of doing that, I've been adding 0xb8000 to everything while writing text to the screen. What is the frame buffer?
|
|||
15 May 2010, 09:41 |
|
edfed 15 May 2010, 09:47
the frame buffer can be:
VGA memory at 0A0000h linear CGA memory at 0B8000h linear vesa memory at vesainfo.ModeInfo_PhysBasePtr linear video buffer where you want (will avoid flikers for graphics modes), to write on, and at vertical retrace, update the frame buffer from it. in fact, frame buffer is not video memory, then, two kinds of things: frame buffer : the memory buffer used to play with. video memory : the memory to update at vertical retrace. Code: ;-------------------------------- FASM VESA INFORMATION BLOCK ----------------------------------- VESA_Info: VESAInfo_Signature rb 4 ; VBE Signature VESAInfo_Version rw 1 ; VBE Version VESAInfo_OEMStringPtr rd 1 ; VbeFarPtr to OEM String VESAInfo_Capabilities rb 4 ; Capabilities of graphics controller VESAInfo_VideoModePtr rd 1 ; VbeFarPtr to VideoModeList VESAInfo_TotalMemory rw 1 ; Number of 64kb memory blocks VESAInfo_OEMSoftwareRev rw 1 ; VBE implementation Software revision VESAInfo_OEMVendorNamePtr rd 1 ; VbeFarPtr to Vendor Name String VESAInfo_OEMProductNamePtr rd 1 ; VbeFarPtr to Product Name String VESAInfo_OEMProductRevPtr rd 1 ; VbeFarPtr to Product Revision String VESAInfo_Reserved rb 222 ; Reserved for VBE implementation scratch area VESAInfo_OEMData rb 256 ; Data Area for OEM Strings ;============================== VESA MODE INFORMATION =========================================== Mode_Info: ModeInfo_ModeAttributes rw 1 ; mode attributes ModeInfo_WinAAttributes rb 1 ; window A attributes ModeInfo_WinBAttributes rb 1 ; window B attributes ModeInfo_WinGranularity rw 1 ; window granularity ModeInfo_WinSize rw 1 ; window size ModeInfo_WinASegment rw 1 ; window A start segment ModeInfo_WinBSegment rw 1 ; window B start segment ModeInfo_WinFuncPtr rd 1 ; real mode pointer to window function ModeInfo_BytesPerScanLine rw 1 ; bytes per scan line ModeInfo_XResolution rw 1 ; horizontal resolution in pixels or characters ModeInfo_YResolution rw 1 ; vertical resolution in pixels or characters ModeInfo_XCharSize rb 1 ; character cell width in pixels ModeInfo_YCharSize rb 1 ; character cell height in pixels ModeInfo_NumberOfPlanes rb 1 ; number of memory planes ModeInfo_BitsPerPixel rb 1 ; bits per pixel ModeInfo_NumberOfBanks rb 1 ; number of banks ModeInfo_MemoryModel rb 1 ; memory model type ModeInfo_BankSize rb 1 ; bank size in KB ModeInfo_NumberOfImagePages rb 1 ; number of images ModeInfo_Reserved_page rb 1 ; reserved for page function ModeInfo_RedMaskSize rb 1 ; size of direct color red mask in bits ModeInfo_RedMaskPos rb 1 ; bit position of lsb of red mask ModeInfo_GreenMaskSize rb 1 ; size of direct color green mask in bits ModeInfo_GreenMaskPos rb 1 ; bit position of lsb of green mask ModeInfo_BlueMaskSize rb 1 ; size of direct color blue mask in bits ModeInfo_BlueMaskPos rb 1 ; bit position of lsb of blue mask ModeInfo_ReservedMaskSize rb 1 ; size of direct color reserved mask in bits ModeInfo_ReservedMaskPos rb 1 ; bit position of lsb of reserved mask ModeInfo_DirectColorModeInfo rb 1 ; direct color mode attributes ; VBE 2.0 extensions ModeInfo_PhysBasePtr rd 1 ; *physical address for flat memory frame buffer* ModeInfo_OffScreenMemOffset rd 1 ; Reserved - always set to 0 ModeInfo_OffScreenMemSize rw 1 ; Reserved - always set to 0 ; VBE 3.0 extensions ModeInfo_LinBytesPerScanLine rw 1 ; bytes per scan line for linear modes ModeInfo_BnkNumberOfPages rb 1 ; number of images for banked modes ModeInfo_LinNumberOfPages rb 1 ; number of images for linear modes ModeInfo_LinRedMaskSize rb 1 ; size of direct color red mask (linear modes) ModeInfo_LinRedFieldPos rb 1 ; bit position of lsb of red mask (linear modes) ModeInfo_LinGreenMaskSize rb 1 ; size of direct color green mask (linear modes) ModeInfo_LinGreenFieldPos rb 1 ; bit position of lsb of green mask (linear modes) ModeInfo_LinBlueMaskSize rb 1 ; size of direct color blue mask (linear modes) ModeInfo_LinBlueFieldPos rb 1 ; bit position of lsb of blue mask (linear modes) ModeInfo_LinRsvdMaskSize rb 1 ; size of direct color reserved mask (linear modes) ModeInfo_LinRsvdFieldPos rb 1 ; bit position of lsb of reserved mask (linear modes) ModeInfo_MaxPixelClock rd 1 ; maximum pixel clock (in Hz) for graphics mode ; Reserved ModeInfo_Reserved rb 190 ; remainder of ModeInfoBlock |
|||
15 May 2010, 09:47 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.