Hi, I am trying util/vgabios but encounter a strange problem: testbios seems fetching wrong instruction
[root@linux vgabios]# ./testbios -s 64k -t ~/lb/500video.bios.bin running file /root/lb/500video.bios.bin No base specified. defaulting to 0xc0000 No initial code segment specified. defaulting to 0xc000 No initial instruction pointer specified. defaulting to 0x0003 Switching to single step mode. AX=00ff BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0005 NV UP DI PL NZ NA PO NC c000:0003 eb53 JMP 58 c000:3 - AX=00ff BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=005a NV UP DI PL NZ NA PO NC c000:0058 0000 ADD [BX+SI],AL c000:58 -
[root@linux lb]# od -x 500vi* |more 0000000 aa55 eb60 3753 3034 3030 c237 2a8a 522a 0000020 5345 5245 4556 2044 00b1 4f46 2052 4249 0000040 204d 4f43 504d 5441 4249 4c49 5449 2a59 0000060 2a2a a807 0000 1090 3130 302f 2f37 3032 0000100 3230 0000 2e31 3431 3c20 4144 203e 2020 0000120 3156 2033 2020 2020 83e9 075e 6f43 7970
testbios said c000:0058 is 0000 but in file, it's E9835E JMP 5EDE
Best Regards!
_________________________________________________________________ 与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn
On Sun, 7 Sep 2003, elife elife wrote:
Hi, I am trying util/vgabios but encounter a strange problem: testbios seems fetching wrong instruction
[root@linux vgabios]# ./testbios -s 64k -t ~/lb/500video.bios.bin running file /root/lb/500video.bios.bin No base specified. defaulting to 0xc0000 No initial code segment specified. defaulting to 0xc000 No initial instruction pointer specified. defaulting to 0x0003 Switching to single step mode. AX=00ff BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0005 NV UP DI PL NZ NA PO NC c000:0003 eb53 JMP 58 c000:3 - AX=00ff BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=005a NV UP DI PL NZ NA PO NC c000:0058 0000 ADD [BX+SI],AL c000:58 -
[root@linux lb]# od -x 500vi* |more 0000000 aa55 eb60 3753 3034 3030 c237 2a8a 522a 0000020 5345 5245 4556 2044 00b1 4f46 2052 4249 0000040 204d 4f43 504d 5441 4249 4c49 5449 2a59 0000060 2a2a a807 0000 1090 3130 302f 2f37 3032 0000100 3230 0000 2e31 3431 3c20 4144 203e 2020 0000120 3156 2033 2020 2020 83e9 075e 6f43 7970
testbios said c000:0058 is 0000 but in file, it's E9835E JMP 5EDE
Best Regards!
interesting, I have seen a similar sort of problem but was not sure what it was. I'll try to take a look.
ron
I finally got the epia 800 (vt8601 chipset) direct register vga working. The diff is short, so I attached it.
A few issues remain. For some reason or other, a warm reset (reboot from Linux) leaves the VGA is a scrambled state. But a hardware reset or cold start is fine. I could not get the current ide to work, so I backed up to the following revisions on ide:
$Id: ide.c,v 1.5 2002/11/11 21:30:45 pyro9 Exp $
$Id: ide.h,v 1.3 2002/12/16 17:57:45 rminnich Exp $
(since my config loads from hda1). It sure appears to me that the repository code for ide is broken, but I did not have time to pin it down.
The main issues preventing the vga from being done much sooner are basically a bunch of extended registers that Via uses, that do not initialize to a useable condition on power-on. Takes a while to find which ones, there are hundreds.
I would not want to do this without a datasheet, so I don't have much hope for the CLE266 unless the VGA is identical or we get a datasheet for it.
-Steve
diff --exclude-from exclude_epia --recursive --unified -P freebios/src/mainboard/via/epia/Config freebios_epia_works/src/mainboard/via/epia/Config --- freebios/src/mainboard/via/epia/Config Sun Sep 7 18:22:01 2003 +++ freebios_epia_works/src/mainboard/via/epia/Config Sun Sep 7 17:24:15 2003 @@ -6,6 +6,7 @@ mainboardinit cpu/i386/reset16.inc ldscript cpu/i386/reset16.lds
+option VGA_HARDWARE_FIXUP=1 mainboardinit superio/via/vt8231/setup_ethernet.inc mainboardinit superio/via/vt8231/setup_serial.inc mainboardinit pc80/serial.inc diff --exclude-from exclude_epia --recursive --unified -P freebios/src/mainboard/via/epia/mainboard.c freebios_epia_works/src/mainboard/via/epia/mainboard.c --- freebios/src/mainboard/via/epia/mainboard.c Sun Sep 7 18:22:01 2003 +++ freebios_epia_works/src/mainboard/via/epia/mainboard.c Sun Sep 7 18:34:15 2003 @@ -2,9 +2,18 @@ #include <pci.h> #include <pci_ids.h> #include <cpu/p5/io.h> +#include <pc80/vga.h>
#include <types.h>
+void northbridge_fixup(); +void southbridge_fixup(); +void video_init(); +void nvram_on(); +void keyboard_on(); +void pci_assign_irqs(unsigned bus, unsigned slot, const unsigned char pIntAtoD[4]); + + static const unsigned char southbridgeIrqs[4] = { 11, 5, 10, 12 }; static const unsigned char enetIrqs[4] = { 11, 5, 10, 12 }; static const unsigned char slotIrqs[4] = { 5, 10, 12, 11 }; @@ -65,6 +74,15 @@
nvram_on(); keyboard_on(); + southbridge_fixup(); + +#ifdef VIDEO_CONSOLE + vga_hardware_fixup(); + // this has to be done here due to pci not always being up + // earlier and pci resources are not ready + video_init(); +#endif + pci_routing_fixup(); }
diff --exclude-from exclude_epia --recursive --unified -P freebios/src/northbridge/via/vt8601/Config freebios_epia_works/src/northbridge/via/vt8601/Config --- freebios/src/northbridge/via/vt8601/Config Sun Sep 7 18:22:01 2003 +++ freebios_epia_works/src/northbridge/via/vt8601/Config Fri Sep 5 10:27:10 2003 @@ -1 +1,2 @@ object northbridge.o +object via_vga.o VIDEO_CONSOLE diff --exclude-from exclude_epia --recursive --unified -P freebios/src/northbridge/via/vt8601/vgainit.inc freebios_epia_works/src/northbridge/via/vt8601/vgainit.inc --- freebios/src/northbridge/via/vt8601/vgainit.inc Sun Sep 7 18:29:59 2003 +++ freebios_epia_works/src/northbridge/via/vt8601/vgainit.inc Sun Sep 7 18:40:42 2003 @@ -21,3 +21,32 @@
#endif
+#if VIDEO_CONSOLE + +/* + * by Steve M. Gehlbach, Ph.D. + * steve @ kesa . com + * + * 9/7/03 smg + * minor chipset settings for vga + * more work needed for init, since reboot + * from linux has problems (hdwr reset okay) + * + */ + // set shadow ram to award settings + + CS_WRITE($0x61, $0x2a) + CS_WRITE($0x62, $0x00) + CS_WRITE($0x63, $0x20) + + // turn off GA + + CS_WRITE($0x88,$0x00) + + // enable vga, fb + + CS_WRITE($0xF9,$0x42) + CS_WRITE($0xFB,$0xb0) + +#endif + diff --exclude-from exclude_epia --recursive --unified -P freebios/src/northbridge/via/vt8601/via_vga.c freebios_epia_works/src/northbridge/via/vt8601/via_vga.c --- freebios/src/northbridge/via/vt8601/via_vga.c Wed Dec 31 16:00:00 1969 +++ freebios_epia_works/src/northbridge/via/vt8601/via_vga.c Sun Sep 7 16:11:37 2003 @@ -0,0 +1,168 @@ +/* + * + * By + * Steve M. Gehlbach <steve @ kesa . com> + * + * vga initialization specific for + * via vt8601 chipset + * + * The font load code follows technique used + * in the tiara project, which came from + * the Universal Talkware Boot Loader, + * http://www.talkware.net. + */ + +#include <video_subr.h> +#include <subr.h> +#include <string.h> +#include <pc80/vga.h> +#include <cpu/p5/io.h> +#include <subr.h> +#include <printk.h> + +#define VGA_FONT_BASE 0xa0000; +#define VGA_GRAFIX_BASE 0xa0000; +#define CHAR_HEIGHT 16 + +// splash_done is a global to avoid putting up splash screen twice. +// Kind of a hack, but the problem is that the vga pci resources +// are sometimes ready early, sort of, and the initial call to +// vga_hardware_fixup puts up the splash screen; then a later call +// to it from hardware_main does it again; but this does not always +// happen, sometimes it fails the first call. It is either a timing or initialization +// problem that needs to be tracked down and fixed. Note that both calls (fixup) are necessary +// since some vga boards are not ready early, but some are, and of course, the epia is sometimes ready +// and sometimes not ready. +// +int splash_done = 0; + +extern unsigned char fontdata_8x16[]; +extern void beep (int msec); +extern void udelay (int usec); + +// The screeninfo structure is in pc80/vga_load_regs.c and has the vga +// parameters for screen size etc. +// This is _not_ the struct used in the zero_page +// for linux init. It is only used for vga init. +extern struct screeninfo vga_settings; + +// prototypes +int vga_decode_var(struct screeninfo *var, struct vga_par *par); +int vga_set_regs(struct vga_par *par); + + +void vga_set_amode(void); +void vga_set_gmode(void); +void delay(int secs); +void mdelay(int msecs); +void vga_font_load(unsigned char *vidmem, unsigned char *font, int height, int num_chars); +int vga_load_pcx( char * pcx_file, int pcx_file_length); + +void vt8601_video_init(void) { + int res; + u8 byte; + struct vga_par vga_params; + + + // convert the general vga parameters in screeninfo structure + // to actual vga register settings + + res = vga_decode_var(&vga_settings, &vga_params); + if ( res < 0 ) { post_code (0xFD); } //no error return for now + + // enable vga system + outb(0x01, 0x3c3); // enable VGA + + // write the registers + res = vga_set_regs( &vga_params ); + if ( res < 0 ) { post_code(0xFE); } //no error return for now + byte = inb(MIS_R); // get 3c2 value by reading 3cc + outb(byte & ~0xc,MIS_W); // clear last bits to set 25Mhz clock + + // enable epia extended regs + write_seq(0x92,0x11); + + // setup the video clocks + // -follows award settings + // not all of these are necessary + write_seq(0xbd,0x18); + write_seq(0xcc,0x19); + write_seq(0xff,0x1a); + write_seq(0xff,0x1b); + write_seq(0x46,0x1c); + write_seq(0xbf,0x1d); + write_seq(0xff,0x1e); + write_seq(0xcc,0x1f); + write_seq(0x04,0x20); + write_seq(0x4f,0x24); + + // setup extended crtc regs + // -follows award settings + // not all of these are necessary + write_crtc(0x64,0x1f); + write_crtc(0x20,0x20); + write_crtc(0x0,0x21); + write_crtc(0x7,0x25); + write_crtc(0x4,0x29); + write_crtc(0x1f,0x2a); + write_crtc(0x0,0x2b); + write_crtc(0xdf,0x2f); + write_crtc(0x10,0x38); + + +} + +#ifdef VGA_HARDWARE_FIXUP +void vga_hardware_fixup(void) { + u8 *font_mem, *vga_mem, *pcx_file; + int *file_size; + +#ifdef PCX_FILE_LOCATION + pcx_file = (u8 *) PCX_FILE_LOCATION; +#else + pcx_file = (u8 *) 0xfffe0000; +#endif + file_size = (int *) pcx_file; + + vga_mem = (u8 *) VGA_GRAFIX_BASE; + font_mem = (u8 *) VGA_FONT_BASE; + + outb(0x01, 0x3b8); // enable VGA + outb(0x01, 0x3c3); // enable VGA + outb(0x08, 0x46e8); // enable VGA (does not appear to be used) + + if (inb(0x3c3) != 1) { + printk_info("VGA not ready yet.\n"); + return; + } + printk_info("Initializing vt8601 vga..."); + post_code(0xa0); + + vt8601_video_init(); + + printk_info("done.\n"); + +#ifdef VIDEO_SHOW_LOGO + if (!splash_done) { + printk_debug("Setting graphics mode...\n"); + vga_set_gmode(); // set graphics mode + + // + // the pcx_file is in flash at an address set + // in the config file with PCX_FILE_LOCATION + // the length of the file is at offset 0, file starts at 4 + // + + printk_debug("pcx file at %x length %d\n",&pcx_file[4], *file_size); + vga_load_pcx( &pcx_file[4], *file_size); + delay(VIDEO_SHOW_LOGO); + +#endif + vga_set_amode(); + vga_font_load(font_mem,fontdata_8x16,CHAR_HEIGHT,256); + splash_done++; // mark done + printk_debug("alpha mode set.\n"); + post_code(0xa1); + } +} +#endif diff --exclude-from exclude_epia --recursive --unified -P freebios/util/config/epia800.config freebios_epia_works/util/config/epia800.config --- freebios/util/config/epia800.config Wed Dec 31 16:00:00 1969 +++ freebios_epia_works/util/config/epia800.config Sun Sep 7 16:48:42 2003 @@ -0,0 +1,63 @@ +# +# LinuxBIOS config file for: VIA epia mini-itx +# + +target /usr/src/epia + +# via epia +mainboard via/epia +biosbase 0xffff0000 + +# setup delay using TSC +option CONFIG_UDELAY_TSC=1 + +# Enable Serial Console for debugging +option CONFIG_COMPRESS=0 +option SERIAL_CONSOLE=1 +option VIDEO_CONSOLE=1 +option TTYS0_BAUD=115200 + +# For printk_debug, set level to 8 +# for printk_info, set level to 7 +#option DEFAULT_CONSOLE_LOGLEVEL=8 +#option DEFAULT_CONSOLE_LOGLEVEL=7 +option DEFAULT_CONSOLE_LOGLEVEL=6 + +#option DEBUG=1 + +option BOOT_IDE=1 +option IDE_BOOT_DRIVE=0 +#need to know size of partition table for ide +#option ONE_TRACK=32 +option ONE_TRACK=63 + + +# the logo is displayed for VIDEO_SHOW_LOGO seconds. +# Need to have to have a 128k rom since the logo image is at the +# beginning (0xfffe0000) +option VIDEO_SHOW_LOGO=10 +option ROM_IMAGE_SIZE=131072 +option PCX_FILE_LOCATION=0xfffe0000 + + +# Use 256KB Standard Flash as Normal BIOS +option RAMTEST=1 + +linux /usr/src/linux +commandline root=/dev/hda2 ro console=ttyS0,115200n8 console=tty1 + +# +# these actions put the pcx image file on the front of the bios. +# the image size is placed in the first 4 bytes then the pcx file +# important that ROM_IMAGE_SIZE be set to 128K or larger. +# The logo file is called linuxbioslogo.pcx and is by default located at +# src/pc80/linuxbioslogo.pcx. +# Change the variable LOGOFILE below if you want to use your own file. +# See the file src/pc80/vga_load_pcx.c for details on the file format. +# +option LOGOFILE=$(TOP)/src/pc80/linuxbioslogo.pcx +addaction linuxbios.rom dd if=$(LOGOFILE) of=linuxbios.rom bs=1 seek=4 conv=notrunc; +addaction linuxbios.rom perl -e '@a=stat "$(LOGOFILE)";$$a=pack("L",$$a[7]); print $$a' | dd of=linuxbios.rom bs=1 conv=notrunc + +# copy to home dir where flash programmer can reach. +addaction linuxbios.rom /bin/cp -f linuxbios.rom $(HOME)/cti/software/bios/exp/linuxbios_epia.bin
we will test and commit if it all works.
I think I'm going to try to get the emulator fixed and long term go with that, but these fixes are needed for the emulator too.
ron
On Sun, Sep 07, 2003 at 07:06:38PM -0700, Steve Gehlbach wrote:
I finally got the epia 800 (vt8601 chipset) direct register vga working. The diff is short, so I attached it.
I tried this tonight and it's working on my EPIA 5000! Thanks for the great work.
However there is some issue. via_vga.c doesn't compile when VIDEO_SHOW_LOGO is not defined. I added an extra #ifdef - #endif to a '}' near the end of the file to compile.
Secondly, shadow ram code in vgainit.inc doesn't work for me, because I don't use "biosbase 0xffff0000" option, the asm part itself executes on the shadowed area. When I added "biosbase 0xffff0000" to my config, it doesn't build because of the binutils issue. I have tried this option before (when my binutils was old) but it just hung, for reason I don't know. So, I just commented out the shadow ram code, and it still works just fine. I don't know if it affects the warm boot issue, since the warm boot always fails for me, I'm always doing a system reset through the ISA bridge.
-- Takeshi
Just wondering, have these changes been merged into the freebios tree? I've been having sporadic VGA problems on my epia800 and wondered if I had the latest or if I should start taking a peek at what is not working..?
diff --exclude-from exclude_epia --recursive --unified -P freebios/src/mainboard/via/epia/Config freebios_epia_works/src/mainboard/via/epia/Config --- freebios/src/mainboard/via/epia/Config Sun Sep 7 18:22:01 2003 +++ freebios_epia_works/src/mainboard/via/epia/Config Sun Sep 7 17:24:15 2003 @@ -6,6 +6,7 @@ mainboardinit cpu/i386/reset16.inc ldscript cpu/i386/reset16.lds
+option VGA_HARDWARE_FIXUP=1 mainboardinit superio/via/vt8231/setup_ethernet.inc mainboardinit superio/via/vt8231/setup_serial.inc mainboardinit pc80/serial.inc diff --exclude-from exclude_epia --recursive --unified -P freebios/src/mainboard/via/epia/mainboard.c freebios_epia_works/src/mainboard/via/epia/mainboard.c --- freebios/src/mainboard/via/epia/mainboard.c Sun Sep 7 18:22:01 2003 +++ freebios_epia_works/src/mainboard/via/epia/mainboard.c Sun Sep 7 18:34:15 2003 @@ -2,9 +2,18 @@ #include <pci.h> #include <pci_ids.h> #include <cpu/p5/io.h> +#include <pc80/vga.h>
#include <types.h>
+void northbridge_fixup(); +void southbridge_fixup(); +void video_init(); +void nvram_on(); +void keyboard_on(); +void pci_assign_irqs(unsigned bus, unsigned slot, const unsigned char pIntAtoD[4]);
static const unsigned char southbridgeIrqs[4] = { 11, 5, 10, 12 }; static const unsigned char enetIrqs[4] = { 11, 5, 10, 12 }; static const unsigned char slotIrqs[4] = { 5, 10, 12, 11 }; @@ -65,6 +74,15 @@
nvram_on(); keyboard_on();
- southbridge_fixup();
+#ifdef VIDEO_CONSOLE
- vga_hardware_fixup();
- // this has to be done here due to pci not always being up
- // earlier and pci resources are not ready
- video_init();
+#endif
- pci_routing_fixup();
}
diff --exclude-from exclude_epia --recursive --unified -P freebios/src/northbridge/via/vt8601/Config freebios_epia_works/src/northbridge/via/vt8601/Config --- freebios/src/northbridge/via/vt8601/Config Sun Sep 7 18:22:01 2003 +++ freebios_epia_works/src/northbridge/via/vt8601/Config Fri Sep 5 10:27:10 2003 @@ -1 +1,2 @@ object northbridge.o +object via_vga.o VIDEO_CONSOLE diff --exclude-from exclude_epia --recursive --unified -P freebios/src/northbridge/via/vt8601/vgainit.inc freebios_epia_works/src/northbridge/via/vt8601/vgainit.inc --- freebios/src/northbridge/via/vt8601/vgainit.inc Sun Sep 7 18:29:59 2003 +++ freebios_epia_works/src/northbridge/via/vt8601/vgainit.inc Sun Sep 7 18:40:42 2003 @@ -21,3 +21,32 @@
#endif
+#if VIDEO_CONSOLE
+/*
- by Steve M. Gehlbach, Ph.D.
- steve @ kesa . com
- 9/7/03 smg
- minor chipset settings for vga
- more work needed for init, since reboot
- from linux has problems (hdwr reset okay)
- */
- // set shadow ram to award settings
- CS_WRITE($0x61, $0x2a)
- CS_WRITE($0x62, $0x00)
- CS_WRITE($0x63, $0x20)
- // turn off GA
- CS_WRITE($0x88,$0x00)
- // enable vga, fb
- CS_WRITE($0xF9,$0x42)
- CS_WRITE($0xFB,$0xb0)
+#endif
diff --exclude-from exclude_epia --recursive --unified -P freebios/src/northbridge/via/vt8601/via_vga.c freebios_epia_works/src/northbridge/via/vt8601/via_vga.c --- freebios/src/northbridge/via/vt8601/via_vga.c Wed Dec 31 16:00:00 1969 +++ freebios_epia_works/src/northbridge/via/vt8601/via_vga.c Sun Sep 7 16:11:37 2003 @@ -0,0 +1,168 @@ +/*
- By
- Steve M. Gehlbach <steve @ kesa . com>
- vga initialization specific for
- via vt8601 chipset
- The font load code follows technique used
- in the tiara project, which came from
- the Universal Talkware Boot Loader,
- */
+#include <video_subr.h> +#include <subr.h> +#include <string.h> +#include <pc80/vga.h> +#include <cpu/p5/io.h> +#include <subr.h> +#include <printk.h>
+#define VGA_FONT_BASE 0xa0000; +#define VGA_GRAFIX_BASE 0xa0000; +#define CHAR_HEIGHT 16
+// splash_done is a global to avoid putting up splash screen twice. +// Kind of a hack, but the problem is that the vga pci resources +// are sometimes ready early, sort of, and the initial call to +// vga_hardware_fixup puts up the splash screen; then a later call +// to it from hardware_main does it again; but this does not always +// happen, sometimes it fails the first call. It is either a timing or initialization +// problem that needs to be tracked down and fixed. Note that both calls (fixup) are necessary +// since some vga boards are not ready early, but some are, and of course, the epia is sometimes ready +// and sometimes not ready. +// +int splash_done = 0;
+extern unsigned char fontdata_8x16[]; +extern void beep (int msec); +extern void udelay (int usec);
+// The screeninfo structure is in pc80/vga_load_regs.c and has the vga +// parameters for screen size etc. +// This is _not_ the struct used in the zero_page +// for linux init. It is only used for vga init. +extern struct screeninfo vga_settings;
+// prototypes +int vga_decode_var(struct screeninfo *var, struct vga_par *par); +int vga_set_regs(struct vga_par *par);
+void vga_set_amode(void); +void vga_set_gmode(void); +void delay(int secs); +void mdelay(int msecs); +void vga_font_load(unsigned char *vidmem, unsigned char *font, int height, int num_chars); +int vga_load_pcx( char * pcx_file, int pcx_file_length);
+void vt8601_video_init(void) {
- int res;
- u8 byte;
- struct vga_par vga_params;
- // convert the general vga parameters in screeninfo structure
- // to actual vga register settings
- res = vga_decode_var(&vga_settings, &vga_params);
- if ( res < 0 ) { post_code (0xFD); } //no error return for now
- // enable vga system
- outb(0x01, 0x3c3); // enable VGA
- // write the registers
- res = vga_set_regs( &vga_params );
- if ( res < 0 ) { post_code(0xFE); } //no error return for now
- byte = inb(MIS_R); // get 3c2 value by reading 3cc
- outb(byte & ~0xc,MIS_W); // clear last bits to set 25Mhz clock
- // enable epia extended regs
- write_seq(0x92,0x11);
- // setup the video clocks
- // -follows award settings
- // not all of these are necessary
- write_seq(0xbd,0x18);
- write_seq(0xcc,0x19);
- write_seq(0xff,0x1a);
- write_seq(0xff,0x1b);
- write_seq(0x46,0x1c);
- write_seq(0xbf,0x1d);
- write_seq(0xff,0x1e);
- write_seq(0xcc,0x1f);
- write_seq(0x04,0x20);
- write_seq(0x4f,0x24);
- // setup extended crtc regs
- // -follows award settings
- // not all of these are necessary
- write_crtc(0x64,0x1f);
- write_crtc(0x20,0x20);
- write_crtc(0x0,0x21);
- write_crtc(0x7,0x25);
- write_crtc(0x4,0x29);
- write_crtc(0x1f,0x2a);
- write_crtc(0x0,0x2b);
- write_crtc(0xdf,0x2f);
- write_crtc(0x10,0x38);
+}
+#ifdef VGA_HARDWARE_FIXUP +void vga_hardware_fixup(void) {
- u8 *font_mem, *vga_mem, *pcx_file;
- int *file_size;
+#ifdef PCX_FILE_LOCATION
- pcx_file = (u8 *) PCX_FILE_LOCATION;
+#else
- pcx_file = (u8 *) 0xfffe0000;
+#endif
- file_size = (int *) pcx_file;
- vga_mem = (u8 *) VGA_GRAFIX_BASE;
- font_mem = (u8 *) VGA_FONT_BASE;
- outb(0x01, 0x3b8); // enable VGA
- outb(0x01, 0x3c3); // enable VGA
- outb(0x08, 0x46e8); // enable VGA (does not appear to be used)
- if (inb(0x3c3) != 1) {
printk_info("VGA not ready yet.\n");
return;
- }
- printk_info("Initializing vt8601 vga...");
- post_code(0xa0);
- vt8601_video_init();
- printk_info("done.\n");
+#ifdef VIDEO_SHOW_LOGO
- if (!splash_done) {
printk_debug("Setting graphics mode...\n");
vga_set_gmode(); // set graphics mode
//
// the pcx_file is in flash at an address set
// in the config file with PCX_FILE_LOCATION
// the length of the file is at offset 0, file starts at 4
//
printk_debug("pcx file at %x length %d\n",&pcx_file[4], *file_size);
vga_load_pcx( &pcx_file[4], *file_size);
delay(VIDEO_SHOW_LOGO);
+#endif
vga_set_amode();
vga_font_load(font_mem,fontdata_8x16,CHAR_HEIGHT,256);
splash_done++; // mark done
printk_debug("alpha mode set.\n");
post_code(0xa1);
- }
+} +#endif diff --exclude-from exclude_epia --recursive --unified -P freebios/util/config/epia800.config freebios_epia_works/util/config/epia800.config --- freebios/util/config/epia800.config Wed Dec 31 16:00:00 1969 +++ freebios_epia_works/util/config/epia800.config Sun Sep 7 16:48:42 2003 @@ -0,0 +1,63 @@ +# +# LinuxBIOS config file for: VIA epia mini-itx +#
+target /usr/src/epia
+# via epia +mainboard via/epia +biosbase 0xffff0000
+# setup delay using TSC +option CONFIG_UDELAY_TSC=1
+# Enable Serial Console for debugging +option CONFIG_COMPRESS=0 +option SERIAL_CONSOLE=1 +option VIDEO_CONSOLE=1 +option TTYS0_BAUD=115200
+# For printk_debug, set level to 8 +# for printk_info, set level to 7 +#option DEFAULT_CONSOLE_LOGLEVEL=8 +#option DEFAULT_CONSOLE_LOGLEVEL=7 +option DEFAULT_CONSOLE_LOGLEVEL=6
+#option DEBUG=1
+option BOOT_IDE=1 +option IDE_BOOT_DRIVE=0 +#need to know size of partition table for ide +#option ONE_TRACK=32 +option ONE_TRACK=63
+# the logo is displayed for VIDEO_SHOW_LOGO seconds. +# Need to have to have a 128k rom since the logo image is at the +# beginning (0xfffe0000) +option VIDEO_SHOW_LOGO=10 +option ROM_IMAGE_SIZE=131072 +option PCX_FILE_LOCATION=0xfffe0000
+# Use 256KB Standard Flash as Normal BIOS +option RAMTEST=1
+linux /usr/src/linux +commandline root=/dev/hda2 ro console=ttyS0,115200n8 console=tty1
+# +# these actions put the pcx image file on the front of the bios. +# the image size is placed in the first 4 bytes then the pcx file +# important that ROM_IMAGE_SIZE be set to 128K or larger. +# The logo file is called linuxbioslogo.pcx and is by default located at +# src/pc80/linuxbioslogo.pcx. +# Change the variable LOGOFILE below if you want to use your own file. +# See the file src/pc80/vga_load_pcx.c for details on the file format. +# +option LOGOFILE=$(TOP)/src/pc80/linuxbioslogo.pcx +addaction linuxbios.rom dd if=$(LOGOFILE) of=linuxbios.rom bs=1 seek=4 conv=notrunc; +addaction linuxbios.rom perl -e '@a=stat "$(LOGOFILE)";$$a=pack("L",$$a[7]); print $$a' | dd of=linuxbios.rom bs=1 conv=notrunc
+# copy to home dir where flash programmer can reach. +addaction linuxbios.rom /bin/cp -f linuxbios.rom $(HOME)/cti/software/bios/exp/linuxbios_epia.bin
I have a few questions regarding the changes you made. I have an epia800 board. I altered the epia.config / HOWTO instructions to boot filo. Once that worked I added to the filo payload the vga bios extracted from the normal bios while running. Now I've applied this patch and I'm trying to figure out the differences between the two. The main difference as I see it is that you use the linux /path/to/linux command and I'm trying to do the payload /path/to/filo+vga... I'm wondering if these two things are compatible? I'm also wondering if I NEED the vga bios extracted still? I'd rather not alter the setup to make it boot from a kernel dd' to the hardrive as I like the fact that filo allows me to boot whatever kernel I feel like. Could you give me a hand so I can alter this. I've looked around and I'm trying to figure out what to change in my config...
diff --exclude-from exclude_epia --recursive --unified -P freebios/util/config/epia800.config freebios_epia_works/util/config/epia800.config --- freebios/util/config/epia800.config Wed Dec 31 16:00:00 1969 +++ freebios_epia_works/util/config/epia800.config Sun Sep 7 16:48:42 2003 @@ -0,0 +1,63 @@ +# +# LinuxBIOS config file for: VIA epia mini-itx +#
+target /usr/src/epia
+# via epia +mainboard via/epia +biosbase 0xffff0000
+# setup delay using TSC +option CONFIG_UDELAY_TSC=1
+# Enable Serial Console for debugging +option CONFIG_COMPRESS=0 +option SERIAL_CONSOLE=1 +option VIDEO_CONSOLE=1 +option TTYS0_BAUD=115200
+# For printk_debug, set level to 8 +# for printk_info, set level to 7 +#option DEFAULT_CONSOLE_LOGLEVEL=8 +#option DEFAULT_CONSOLE_LOGLEVEL=7 +option DEFAULT_CONSOLE_LOGLEVEL=6
+#option DEBUG=1
+option BOOT_IDE=1 +option IDE_BOOT_DRIVE=0 +#need to know size of partition table for ide +#option ONE_TRACK=32 +option ONE_TRACK=63
+# the logo is displayed for VIDEO_SHOW_LOGO seconds. +# Need to have to have a 128k rom since the logo image is at the +# beginning (0xfffe0000) +option VIDEO_SHOW_LOGO=10 +option ROM_IMAGE_SIZE=131072 +option PCX_FILE_LOCATION=0xfffe0000
+# Use 256KB Standard Flash as Normal BIOS +option RAMTEST=1
+linux /usr/src/linux +commandline root=/dev/hda2 ro console=ttyS0,115200n8 console=tty1
+# +# these actions put the pcx image file on the front of the bios. +# the image size is placed in the first 4 bytes then the pcx file +# important that ROM_IMAGE_SIZE be set to 128K or larger. +# The logo file is called linuxbioslogo.pcx and is by default located at +# src/pc80/linuxbioslogo.pcx. +# Change the variable LOGOFILE below if you want to use your own file. +# See the file src/pc80/vga_load_pcx.c for details on the file format. +# +option LOGOFILE=$(TOP)/src/pc80/linuxbioslogo.pcx +addaction linuxbios.rom dd if=$(LOGOFILE) of=linuxbios.rom bs=1 seek=4 conv=notrunc; +addaction linuxbios.rom perl -e '@a=stat "$(LOGOFILE)";$$a=pack("L",$$a[7]); print $$a' | dd of=linuxbios.rom bs=1 conv=notrunc
+# copy to home dir where flash programmer can reach. +addaction linuxbios.rom /bin/cp -f linuxbios.rom $(HOME)/cti/software/bios/exp/linuxbios_epia.bin
Nathanael Noblet wrote:
I'm also wondering if I NEED the vga bios extracted still?
The mod's that I made are for using vga without any vga bios by directly writing the chipset registers and legacy vga registers to put it in legacy vga mode. But it is only for text mode, so if you need extended graphics that is another matter.
-Steve
On Saturday, September 20, 2003, at 10:21 PM, Steve Gehlbach wrote:
Nathanael Noblet wrote:
I'm also wondering if I NEED the vga bios extracted still?
The mod's that I made are for using vga without any vga bios by directly writing the chipset registers and legacy vga registers to put it in legacy vga mode. But it is only for text mode, so if you need extended graphics that is another matter.
I don't need a framebuffer on boot, but once loaded would I be able to insmod the epiafb module and get that working? If that is the case, the boot sequence can be anything...
Though, I'm wondering if the modifications you've made are (specifically the epia800.config) are compatible with an elf filo payload? The add action commands seem to run after the commands that concatenate the linuxbios image file with its payload.. so I'm somewhat at a loss as to what to flash the chip with. If you know what I mean.
Nathanael Noblet wrote:
I don't need a framebuffer on boot, but once loaded would I be able to insmod the epiafb module and get that working?
More than likely, since a framebuffer driver made for epia vga must have intimate knowledge of the chipset, so it should completely initialize it.
Though, I'm wondering if the modifications you've made are (specifically the epia800.config) are compatible with an elf filo payload? The add action commands seem to run after the commands that concatenate the linuxbios image file with its payload.. so I'm somewhat at a loss as to what to flash the chip with. If you know what I mean.
I have not used payloads, so I am not sure, maybe others can comment. If you comment out VIDEO_SHOW_LOGO and the addactions, though, there is a bug in the file via_vga.c, you will need reverse two lines:
#ifdef VIDEO_SHOW_LOGO if (!splash_done) {
change it to: if (!splash_done) { #ifdef VIDEO_SHOW_LOGO
-Steve
On Sat, Sep 20, 2003 at 11:25:58PM -0700, Steve Gehlbach wrote:
Nathanael Noblet wrote:
I don't need a framebuffer on boot, but once loaded would I be able to insmod the epiafb module and get that working?
More than likely, since a framebuffer driver made for epia vga must have intimate knowledge of the chipset, so it should completely initialize it.
Unfortunately it does not. Looks like we have to program some more VGA registers for framebuffer to function properly.
Though, I'm wondering if the modifications you've made are (specifically the epia800.config) are compatible with an elf filo payload? The add action commands seem to run after the commands that concatenate the linuxbios image file with its payload.. so I'm somewhat at a loss as to what to flash the chip with. If you know what I mean.
I have not used payloads, so I am not sure, maybe others can comment.
Steve's config uses linux loader rather than ELF loader.
SONE Takeshi wrote:
On Sat, Sep 20, 2003 at 11:25:58PM -0700, Steve Gehlbach wrote:
Nathanael Noblet wrote:
I don't need a framebuffer on boot, but once loaded would I be able to insmod the epiafb module and get that working?
More than likely, since a framebuffer driver made for epia vga must have intimate knowledge of the chipset, so it should completely initialize it.
Unfortunately it does not. Looks like we have to program some more VGA registers for framebuffer to function properly.
Hmmm... this is strange. Has anyone used HAVE_FRAMEBUFFER option without VIDEO_CONSOLE and gotten that to work? The only difference is the 0xFB chipset register, however, the setting I use matches the Award setting when it boots. The HAVE_FRAMEBUFER sets the framebuffer size to something different, but I don't think this is releveant, my setting would be 8M but the frambuffer access bit (bit 3) is off, and the address of the framebuffer is not set (bits 2-0 and reg 0xFA and others).
I suspect it has something to do with the graphics aperture settings (GA). The GA relevant registers are 0x13 and 0x80-0x8B. You can try putting in the settings at the bottom of afteram.inc (this file is not used in my config), the CS_WRITE commands to 0x13, 0x84, 0x80, 0x88. These match the Award settings, except for 0x84, which is 0 in Award (256M aperture) rather than 0xc0 (64M aperture). I know that these registers can cause hangs, though. I would try putting these in the vgainit.inc file replacing the 0x88 setting where it says "turn off GA".
Which epiafb are you using? Maybe I can try it later this week, but I am not a big user of framebuffers.
-Steve
On Sunday, September 21, 2003, at 11:49 AM, Steve Gehlbach wrote:
SONE Takeshi wrote:
On Sat, Sep 20, 2003 at 11:25:58PM -0700, Steve Gehlbach wrote:
Nathanael Noblet wrote:
I don't need a framebuffer on boot, but once loaded would I be able to insmod the epiafb module and get that working?
More than likely, since a framebuffer driver made for epia vga must have intimate knowledge of the chipset, so it should completely initialize it.
Unfortunately it does not. Looks like we have to program some more VGA registers for framebuffer to function properly.
Hmmm... this is strange. Has anyone used HAVE_FRAMEBUFFER option without VIDEO_CONSOLE and gotten that to work? The only difference is the 0xFB chipset register, however, the setting I use matches the Award setting when it boots. The HAVE_FRAMEBUFER sets the framebuffer size to something different, but I don't think this is releveant, my setting would be 8M but the frambuffer access bit (bit 3) is off, and the address of the framebuffer is not set (bits 2-0 and reg 0xFA and others).
I suspect it has something to do with the graphics aperture settings (GA). The GA relevant registers are 0x13 and 0x80-0x8B. You can try putting in the settings at the bottom of afteram.inc (this file is not used in my config), the CS_WRITE commands to 0x13, 0x84, 0x80, 0x88. These match the Award settings, except for 0x84, which is 0 in Award (256M aperture) rather than 0xc0 (64M aperture). I know that these registers can cause hangs, though. I would try putting these in the vgainit.inc file replacing the 0x88 setting where it says "turn off GA".
Which epiafb are you using? Maybe I can try it later this week, but I am not a big user of framebuffers.
I've used the epiafb (epiafb.sf.net) and I'm currently working on getting the tridentfb to work. I am noticing some kernel oops? Though the system is still functional, but the vga console is garbled.
I have yet to get the epiafb working or even try the tridentfb with a linuxbios boot. The epia complains of unresolved dependancies which look like missing symbols for the generic framebuffer, even though that is loaded... so I'm not sure what is going on there.
I have been taking lspci -xxx output of each boot, normal boot, filo boot, filo with vgabios extracted boot. I have noticed differences in the register settings between the two. Where do you get the CS_WRITE and register information about this board? And more importantly, can I have a copy?
I have yet to get your changes to work though, mainly because of the difference in the payloads, though that is on my list of getting working. I'd like to see from there how it goes. I haven't looked much at the new code you supplied a diff for, but will be poking around there, though a spec sheet as always would be nice.
Thanks so far for the work and information...
On Sun, Sep 21, 2003 at 12:25:01PM -0600, Nathanael Noblet wrote:
I have yet to get the epiafb working or even try the tridentfb with a linuxbios boot. The epia complains of unresolved dependancies which look like missing symbols for the generic framebuffer, even though that is loaded... so I'm not sure what is going on there.
Did you enabled (and build and insmod) kernel options like "8 bpp packed pixels support" (and others)? I think this is bug in epiafb documentation.
On Sunday, September 21, 2003, at 12:59 PM, SONE Takeshi wrote:
On Sun, Sep 21, 2003 at 12:25:01PM -0600, Nathanael Noblet wrote:
I have yet to get the epiafb working or even try the tridentfb with a linuxbios boot. The epia complains of unresolved dependancies which look like missing symbols for the generic framebuffer, even though that is loaded... so I'm not sure what is going on there.
Did you enabled (and build and insmod) kernel options like "8 bpp packed pixels support" (and others)? I think this is bug in epiafb documentation.
Not sure, I'm using the stock kernel that came with my distro (RedHat at the moment)... It works when the original bios is booted. I have only moments ago realized which modules weren't being loaded (the fb_con-*) which once loaded I loaded the vesafb module. I'll try the epiafb next.
At the moment though, I'm having difficulty getting filo to boot anything but the original kernel.
Here is what I have done. Perhaps you have insight into the problem.
in the filo Config file: AUTOBOOT_FILE = "hda1:/epia.vmlinuz root...."
now if I, using the boot prompt provided by filo, attempt to boot any other kernel, specifically in this instance a 2.4.22 vanilla kernel, compiled on the target machine, and which mkelfimage 2.5 has been run against. It says it cannot find the file. I couldn't figure out why. I used epia.vmlinuz-2.4.22 as a name, thought perhaps that FILO couldn't read it for one reason or another, filename length or something. Anyway so I copied it to epia.vmlinux22, no go there either. So then I made a backup of the epia.vmlinuz as epia.vmlinuz-bak and overwrote the epia.vmlinuz file with my 2.4.22 version and rebooted. Let it autoboot, which it did, but well it booted the elf image version of the original kernel 2.4.20-20.9 (the Redhat one that I had renamed and overwritten with something else) not sure what is happening here.
On Sun, Sep 21, 2003 at 01:09:06PM -0600, Nathanael Noblet wrote:
At the moment though, I'm having difficulty getting filo to boot anything but the original kernel.
Here is what I have done. Perhaps you have insight into the problem.
in the filo Config file: AUTOBOOT_FILE = "hda1:/epia.vmlinuz root...."
Could you enable DEBUG_ALL, and also add a line "E2DEBUG = 1" to Config (if the kernel is on ext2/3 fs. For other filesystems you could use relevant debug option, find it in the fs directory). It will spit out lots of messages, more than you ever want.
On Sunday, September 21, 2003, at 01:28 PM, SONE Takeshi wrote:
On Sun, Sep 21, 2003 at 01:09:06PM -0600, Nathanael Noblet wrote:
At the moment though, I'm having difficulty getting filo to boot anything but the original kernel.
Here is what I have done. Perhaps you have insight into the problem.
in the filo Config file: AUTOBOOT_FILE = "hda1:/epia.vmlinuz root...."
Could you enable DEBUG_ALL, and also add a line "E2DEBUG = 1" to Config (if the kernel is on ext2/3 fs. For other filesystems you could use relevant debug option, find it in the fs directory). It will spit out lots of messages, more than you ever want.
doing that now. I'll send the debug messages if I can't figure it out myself just a FYI, I removed the file from the partition and it is still booting using that file apparently??? I'm really at a loss now, hopefully this debug messages gives me a clue as to what is happening.
On Sunday, September 21, 2003, at 01:28 PM, SONE Takeshi wrote:
On Sun, Sep 21, 2003 at 01:09:06PM -0600, Nathanael Noblet wrote:
At the moment though, I'm having difficulty getting filo to boot anything but the original kernel.
Here is what I have done. Perhaps you have insight into the problem.
in the filo Config file: AUTOBOOT_FILE = "hda1:/epia.vmlinuz root...."
Could you enable DEBUG_ALL, and also add a line "E2DEBUG = 1" to Config (if the kernel is on ext2/3 fs.
Ok so this is embarrassing, somehow I had a stray old boot partition that had the image on it but not the others... I figured that part out after it could boot without there being the file there at all... took a look at the partition table and such... Anyway so it is now booting with VGABIOS and FRAMEBUFFER etc... I can load the epiafb and get a console FB working. The problem I had after this (this is the second time I go through this... I want to really understand what I'm doing) I couldn't run any of the DirectFB example apps... I bet this has to do with those extended registers that we're missing... I will be getting the different lspci register dumps to compare the regular AWARD bios settings and the linuxbios vga settings.
And HOWTO on these last steps, with sample kernel .config, is most welcome.
ron
On Sun, Sep 21, 2003 at 10:49:46AM -0700, Steve Gehlbach wrote:
Hmmm... this is strange. Has anyone used HAVE_FRAMEBUFFER option without VIDEO_CONSOLE and gotten that to work? The only difference is the 0xFB chipset register, however, the setting I use matches the Award setting when it boots. The HAVE_FRAMEBUFER sets the framebuffer size to something different, but I don't think this is releveant, my setting would be 8M but the frambuffer access bit (bit 3) is off, and the address of the framebuffer is not set (bits 2-0 and reg 0xFA and others).
Both HAVE_FRAMEBUFFER and VIDEO_CONSOLE set 0xB0 to register 0xFB in a default config (SMA_SIZE==8).
With only this setting, if I run the factory VGABIOS, it does all the rest of configuation to VGA (and TV encoder also), and I can use epiafb, or even X, with TV-out, flawlessly.
I don't touch GA registers, neither do VGABIOS.
So I think the missing bit is in the VGA registers.
SONE Takeshi wrote:
Both HAVE_FRAMEBUFFER and VIDEO_CONSOLE set 0xB0 to register 0xFB in a default config (SMA_SIZE==8).
With only this setting, if I run the factory VGABIOS, it does all the rest of configuation to VGA (and TV encoder also), and I can use epiafb, or even X, with TV-out, flawlessly.
I don't touch GA registers, neither do VGABIOS.
So I think the missing bit is in the VGA registers.
Hmmm... well if it is not the GA setup, then this could be more difficult.
I see that the epiafb is not a binary from via, as I was assuming, but open source. So at least we can look at the code and see what they are doing. There are quite a number of extended function vga registers in the epia, however, so it is hard to know which ones are important.
Probably the way to proceed on this is to take a snap of the vga extended registers with Award, then boot with linuxbios and set some registers to match Award that look promising, and each time try insmod'ing the driver until it works. This takes some simple C code to set and read the various vga registers, which I have, so I will try this when I get a chance.
-Steve
I saw a discussion in the list on the same problem with epia800. Since one week we are working on a solution for having text console and framebuffer for national's SC1200. We came to the same result that the problem must be the vga registers which were normally set by the vgabios. So if we startup the system with linuxbios the vga registers are not set and we dont have a screen output on crt. If we boot with i.e. insyde bios we have output on crt.
Is there anyone who solved this problem for SC1200?
Benno
On Mon, 22 Sep 2003, Bernd Modeker wrote:
Is there anyone who solved this problem for SC1200?
not yet. If you have a copy of the vgabios binary for that hardware you could try seeing if it would work.
The vga register problem is a mess, as the vendors rarely want to help.
ron
Is there anyone who solved this problem for SC1200?
not yet. If you have a copy of the vgabios binary for that hardware you could try seeing if it would work.
I tried the following bios which I extracted from insyde bios:
sh-2.05b# ./testbios elpin.vga -d 94 running file elpin.vga No size specified. defaulting to 32k No base specified. defaulting to 0xc0000 No initial code segment specified. defaulting to 0xc000 No initial instruction pointer specified. defaulting to 0x0003 halt_sys: file ops.c, line 9836 halted sh-2.05b#
What you see is NOTHING. At single stepping I saw that there is an PCI access to 80009400 for reading ID's. This access returns the wrong values.
sh-2.05b# ./testbios elpin.vga -d 0x94 -t running file elpin.vga No size specified. defaulting to 32k No base specified. defaulting to 0xc0000 No initial code segment specified. defaulting to 0xc000 No initial instruction pointer specified. defaulting to 0x0003 Switching to single step mode. AX=0094 BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0005 NV UP DI PL NZ NA PO NC c000:0003 eb4b JMP 50 c000:3 - AX=0094 BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0052 NV UP DI PL NZ NA PO NC c000:0050 eb41 JMP 93 c000:50 - AX=0094 BX=0000 CX=0000 DX=0080 SP=fff8 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0094 NV UP DI PL NZ NA PO NC c000:0093 55 PUSH BP c000:93 - AX=0094 BX=0000 CX=0000 DX=0080 SP=fff6 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0096 NV UP DI PL NZ NA PO NC c000:0094 2bc0 SUB AX,AX c000:94 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff6 BP=0000 SI=0000 DI=0000 DS=0040 ES=0000 SS=0030 CS=c000 IP=0098 NV UP DI PL ZR NA PE NC c000:0096 8ed8 MOV DS,AX c000:96 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff6 BP=0000 SI=0000 DI=0000 DS=0000 ES=0000 SS=0030 CS=c000 IP=0099 NV UP DI PL ZR NA PE NC c000:0098 0e PUSH CS c000:98 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff4 BP=0000 SI=0000 DI=0000 DS=0000 ES=0000 SS=0030 CS=c000 IP=009a NV UP DI PL ZR NA PE NC c000:0099 07 POP ES c000:99 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff6 BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=009d NV UP DI PL ZR NA PE NC c000:009a e87300 CALL 0110 c000:9a - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff4 BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0111 NV UP DI PL ZR NA PE NC c000:0110 66 DATA: c000:110 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff4 BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0112 NV UP DI PL ZR NA PE NC c000:0111 50 PUSH EAX c000:111 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff0 BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0113 NV UP DI PL ZR NA PE NC c000:0112 66 DATA: c000:112 - AX=0000 BX=0000 CX=0000 DX=0080 SP=fff0 BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0114 NV UP DI PL ZR NA PE NC c000:0113 53 PUSH EBX c000:113 - AX=0000 BX=0000 CX=0000 DX=0080 SP=ffec BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0115 NV UP DI PL ZR NA PE NC c000:0114 52 PUSH DX c000:114 - AX=0000 BX=0000 CX=0000 DX=0080 SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0118 NV UP DI PL ZR NA PE NC c000:0115 baf80c MOV DX,cf8 c000:115 - AX=0000 BX=0000 CX=0000 DX=0cf8 SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0119 NV UP DI PL ZR NA PE NC c000:0118 66 DATA: c000:118 - AX=0000 BX=0000 CX=0000 DX=0cf8 SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=011e NV UP DI PL ZR NA PE NC c000:0119 b800940080 MOV EAX,80009400 c000:119 - AX=9400 BX=0000 CX=0000 DX=0cf8 SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=011f NV UP DI PL ZR NA PE NC c000:011e 66 DATA: c000:11e - AX=9400 BX=0000 CX=0000 DX=0cf8 SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0120 NV UP DI PL ZR NA PE NC c000:011f ef OUT DX,EAX c000:11f - AX=9400 BX=0000 CX=0000 DX=0cf8 SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0123 NV UP DI PL ZR NA PE NC c000:0120 bafc0c MOV DX,cfc c000:120 - AX=9400 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0124 NV UP DI PL ZR NA PE NC c000:0123 66 DATA: c000:123 - AX=9400 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0125 NV UP DI PL ZR NA PE NC c000:0124 ed IN EAX,DX c000:124 - AX=4000 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0126 NV UP DI PL ZR NA PE NC c000:0125 66 DATA: c000:125 -
Any advises? Bernd
The vga register problem is a mess, as the vendors rarely want to help.
ron
Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios
On Tue, 23 Sep 2003, Bernd Modeker wrote:
I tried the following bios which I extracted from insyde bios:
sh-2.05b# ./testbios elpin.vga -d 94 running file elpin.vga No size specified. defaulting to 32k No base specified. defaulting to 0xc0000 No initial code segment specified. defaulting to 0xc000 No initial instruction pointer specified. defaulting to 0x0003 halt_sys: file ops.c, line 9836 halted sh-2.05b#
that's annoying. I've tried to add more helpful output to the x86 emulator from X11 (such as all the messages above) but obviously I missed some important bits.
can you decode this a bit for me? What is it looking for in terms of devid, and how is the pci read returning wrong values?
ron
I tried the following bios which I extracted from insyde bios:
sh-2.05b# ./testbios elpin.vga -d 94 running file elpin.vga No size specified. defaulting to 32k No base specified. defaulting to 0xc0000 No initial code segment specified. defaulting to 0xc000 No initial instruction pointer specified. defaulting to 0x0003 halt_sys: file ops.c, line 9836 halted sh-2.05b#
that's annoying. I've tried to add more helpful output to the x86 emulator from X11 (such as all the messages above) but obviously I missed some important bits.
can you decode this a bit for me? What is it looking for in terms of devid, and how is the pci read returning wrong values?
the internal vga pci device at 0:12.4 should be found when you write 0x80009400 to pci index reg 0xcf8. After that the value 0x0504100b should be returned at 0xcfc as vendor id (0x100b) and device id (0x0504). After single stepping this return value AX is set to 0x4000 and not 0x100b. Unfortunaly EAX is not printed:
c000:0124 ed IN EAX,DX c000:124 - AX=4000 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0126 NV UP DI PL ZR NA PE NC
If I check this with the pciset tool I get the right values back. Also I tried to read these value back under InsydeBIOS with bootet DOS.
Bernd
ron
Linuxbios mailing list Linuxbios@clustermatic.org http://www.clustermatic.org/mailman/listinfo/linuxbios
On Tue, 23 Sep 2003, Bernd Mödeker wrote:
the internal vga pci device at 0:12.4 should be found when you write 0x80009400 to pci index reg 0xcf8. After that the value 0x0504100b should be returned at 0xcfc as vendor id (0x100b) and device id (0x0504). After single stepping this return value AX is set to 0x4000 and not 0x100b. Unfortunaly EAX is not printed:
c000:0124 ed IN EAX,DX c000:124 - AX=4000 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0126 NV UP DI PL ZR NA PE NC
you're not going to get eax in an 8086. This is an issue.
I wonder if there is an enable for the vga device that we are not setting.
ron
On Tue, 23 Sep 2003, ron minnich wrote:
c000:0124 ed IN EAX,DX
no 66 prefix means it really is 16 bits, btw.
Anyway, can you check and see if there is a vga enable? there almost always is in these chipsets.
ron
I forgot this here: c000:0123 66 DATA: c000:123 - AX=9400 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0125 NV UP DI PL ZR NA PE NC
c000:0124 ed IN EAX,DX
no 66 prefix means it really is 16 bits, btw.
So there is an prefix!
Anyway, can you check and see if there is a vga enable? there almost always is in these chipsets.
The vga device is enabled. If I use devmem I can read the vendor and device ID and the enabled VGA device. PCI function 4 for this vga device is enabled. So the elpin vga bios should be able to read this ID's too.
Bernd
On Tue, Sep 23, 2003 at 10:19:56PM +0200, Bernd Mödeker wrote:
Anyway, can you check and see if there is a vga enable? there almost always is in these chipsets.
The vga device is enabled. If I use devmem I can read the vendor and device ID and the enabled VGA device. PCI function 4 for this vga device is enabled. So the elpin vga bios should be able to read this ID's too.
Maybe the BLDT and/or some revenging of the VGA VSM could point to the right bits.
Also see Christer Weinigel's work in the nano port, although I don't remember if he had graphics up on it. I seem to recall it used the SC2200 which has an LCD driver as it's speciality.
//Peter
On Wed, 24 Sep 2003, Peter Stuge wrote:
On Tue, Sep 23, 2003 at 10:19:56PM +0200, Bernd Mödeker wrote:
Anyway, can you check and see if there is a vga enable? there almost always is in these chipsets.
The vga device is enabled. If I use devmem I can read the vendor and device ID and the enabled VGA device. PCI function 4 for this vga device is enabled. So the elpin vga bios should be able to read this ID's too.
Maybe the BLDT and/or some revenging of the VGA VSM could point to the right bits.
I am guessing bug in the testbios code, I'm just trying to narrow it down.
ron
the internal vga pci device at 0:12.4 should be found when you write 0x80009400 to pci index reg 0xcf8. After that the value 0x0504100b should be returned at 0xcfc as
vendor
id (0x100b) and device id (0x0504). After single stepping this return value AX is set to 0x4000 and not
0x100b.
Unfortunaly EAX is not printed:
c000:0124 ed IN EAX,DX c000:124 - AX=4000 BX=0000 CX=0000 DX=0cfc SP=ffea BP=0000 SI=0000 DI=0000 DS=0000 ES=c000 SS=0030 CS=c000 IP=0126 NV UP DI PL ZR NA
PE
NC
you're not going to get eax in an 8086. This is an issue.
ok this seems to be a fact
I wonder if there is an enable for the vga device that we are not setting.
I could'nt follow. What do you mean? Bernd
On Tue, 23 Sep 2003, Bernd Mödeker wrote:
I could'nt follow. What do you mean?
frequently, in the north bridge, there is a magic bit in some register in device 0:0.0 that enables the VGA hardware. If you don't set it, the VGA hardware will act like it is not there when you probe it.
ron