vesafb на S3 Trio64: глаза боялись, а руки сделали.
Здравствуйте.
В инете нашелся патч для ядер 2.4, а у меня 2.6.11.7.
http://lists.bxlug.be/pipermail/linux-bruxelles/2002-May/002485.html
С ходу этот патч не пошел, пришлось маленько его поправить.
После этого получилась таки фреймбуфферная консоль.
Правда, русский шрифт работакт только на /dev/pts/0.
На остальных - квадратики. Что править?
[root@localhost ~]# fbset -i
mode "1024x768-76"
# D: 78.653 MHz, H: 59.949 kHz, V: 75.694 Hz
geometry 1024 768 1024 768 8
timings 12714 128 32 16 4 128 4
rgba 8/0,8/0,8/0,6/0
endmode
Frame buffer device information:
Name : VESA VGA
Address : 0xe0000000
Size : 1572864
Type : PACKED PIXELS
Visual : PSEUDOCOLOR
XPanStep : 0
YPanStep : 0
YWrapStep : 0
LineLength : 1024
Accelerator : No
А вот и сам патч, который у меня получился, может кому пригодится.
arch/i386/boot/video.S.orig 2005-04-08 02:58:45.000000000 +0800
+++ arch/i386/boot/video.S 2005-05-24 08:28:45.000000000 +0800
@ -509,6 +509,9 @@
setvesa:
DO_STORE
subb $VIDEO_FIRST_VESA>>8, %bh
+#ifndef CONFIG_FB_S3CARD
+ orw $0x4000, %bx # Use linear frame buffer
+#endif
movw $0x4f02, %ax # VESA BIOS mode set call
int $0x10
cmpw $0x004f, %ax # AL=4f if implemented
@ -582,13 +585,22 @@
cmpb $0x09, %al
jz setvesa # This is a text mode
+#ifdef CONFIG_FB_S3CARD
+#
+# removed the check for linear frame buffer as
+# we're going to try and turn it on ourselves
+#
+#else
movb (%di), %al # Check capabilities.
andb $0x99, %al
cmpb $0x99, %al
jnz _setbad # Doh! No linear frame buffer.
+#endif
subb $VIDEO_FIRST_VESA>>8, %bh
+#ifndef CONFIG_FB_S3CARD
orw $0x4000, %bx # Use linear frame buffer
+#endif
movw $0x4f02, %ax # VESA BIOS mode set call
int $0x10
cmpw $0x004f, %ax # AL=4f if implemented
drivers/video/Kconfig.orig 2005-04-08 02:57:09.000000000 +0800
+++ drivers/video/Kconfig 2005-05-23 19:37:38.000000000 +0800
@ -337,6 +337,10 @@
You will get a boot time penguin logo at no additional cost. Please
read <file:Documentation/fb/vesafb.txt>. If unsure, say Y.
+config FB_S3CARD
+ bool "S3 display support"
+ depends on FB_VESA && PCI && (X86 || X86_64)
+
config VIDEO_SELECT
bool
depends on FB_VESA
drivers/video/vesafb.c.orig 2005-05-23 19:34:19.000000000 +0800
+++ drivers/video/vesafb.c 2005-05-23 19:43:06.000000000 +0800
@ -24,6 +24,7 @@
#endif
#include <asm/io.h>
#include <asm/mtrr.h>
+#include <linux/pci.h>
#define dac_reg (0x3c8)
#define dac_val (0x3c9)
@ -235,6 +236,72 @@
if (screen_info.orig_video_isVGA != VIDEO_TYPE_VLFB)
return -ENODEV;
+#ifdef CONFIG_FB_S3CARD
+ do {
+ /* try and enable linear frame buffer on S3 cards */
+
+ struct pci_dev *dev;
+ u8 tmp;
+
+ /* find S3 on PCI bus */
+ for(dev = pci_dev_g(pci_devices.next);
+ dev != pci_dev_g(&pci_devices) &&
+ (dev->vendor != PCI_VENDOR_ID_S3 ||
+ dev->class >> 8 != PCI_CLASS_DISPLAY_VGA);
+ dev = pci_dev_g(dev->global_list.next) ) ;
+
+ if ( !dev ) {
+ break;
+ }
+
+ /* unlock S3 registers */
+ outb_p(0x38, crtc_adr); outb_p(0x48, crtc_val);
+ outb_p(0x39, crtc_adr); outb_p(0xa5, crtc_val);
+
+ /* check that CR47 is read/write */
+ outb_p(0x47, crtc_adr); outb_p(0xff, crtc_val);
+ tmp = inb_p(crtc_val);
+ outb_p(0x00, crtc_val);
+ if(tmp != 0xff || inb_p(crtc_val))
+ {
+ /* lock S3 registers */
+ outb_p(0x39, crtc_adr); outb_p(0x5a, crtc_val);
+ outb_p(0x38, crtc_adr); outb_p(0x00, crtc_val);
+
+ break;
+ }
+
+ printk("vesafb: enabling S3 linear frame buffer\n");
+
+ /* enable enhanced register access */
+ outb_p(0x40, crtc_adr); outb_p(inb_p(crtc_val) | 1, crtc_val);
+
+ /* enable enhanced functions */
+ outb_p(inb_p(0x4ae8) | 1, 0x4ae8);
+
+ /* enable enhanced mode memory mapping */
+ outb_p(0x31, crtc_adr); outb_p(inb_p(crtc_val) | 8, crtc_val);
+
+ /* enable linear frame buffer and set address window to max */
+ outb_p(0x58, crtc_adr); outb_p(inb_p(crtc_val) | 0x13,crtc_val);
+
+ /* disabled enhanced register access */
+ outb_p(0x40, crtc_adr); outb_p(inb_p(crtc_val) & ~1, crtc_val);
+
+ /* lock S3 registers */
+ outb_p(0x39, crtc_adr); outb_p(0x5a, crtc_val);
+ outb_p(0x38, crtc_adr); outb_p(0x00, crtc_val);
+
+ /* save base address */
+ screen_info.lfb_base = dev->resource[0].start & PCI_BASE_ADDRESS_MEM_MASK;
+
+ /* disable fancy stuff */
+ screen_info.vesapm_seg = 0;
+
+ } while(0);
+#endif
+
+
vesafb_fix.smem_start = screen_info.lfb_base;
vesafb_defined.bits_per_pixel = screen_info.lfb_depth;
if (15 == vesafb_defined.bits_per_pixel)
В сообщении от 1116917779 секунд после начала Эпохи Unix Вы написали:
Э-э а причем тут псевдотерминалы? Может имелось в виду `/dev/tty1'?