[openfirmware] r1108 - in cpu/x86/pc: biosload olpc

svn at openfirmware.info svn at openfirmware.info
Fri Feb 20 10:17:56 CET 2009


Author: wmb
Date: 2009-02-20 10:17:56 +0100 (Fri, 20 Feb 2009)
New Revision: 1108

Modified:
   cpu/x86/pc/biosload/c32vesa.fth
   cpu/x86/pc/biosload/callvbe.fth
   cpu/x86/pc/biosload/fw.bth
   cpu/x86/pc/olpc/iflash.fth
Log:
Biosload version - improvements to VESA BIOS handling under Syslinux.





Modified: cpu/x86/pc/biosload/c32vesa.fth
===================================================================
--- cpu/x86/pc/biosload/c32vesa.fth	2009-02-20 09:14:16 UTC (rev 1107)
+++ cpu/x86/pc/biosload/c32vesa.fth	2009-02-20 09:17:56 UTC (rev 1108)
@@ -1,8 +1,8 @@
 purpose: Call VESA BIOS functions via syslinux c32 callback
 
-[ifdef] notdef-get-com32-ptr
-\  sp  0 #)  mov  \ Save COM32 stack pointer to get parameters
-[then]
+\ [ifdef] notdef-get-com32-ptr
+   sp  0 #)  mov  \ Save COM32 stack pointer for possible later use
+\ [then]
 [ifdef] notdef-getvbe
    \ There is an extra return address on the stack from the e9 call above
    d# 16 [sp]  bp  mov  \ COM32 intcall helper function

Modified: cpu/x86/pc/biosload/callvbe.fth
===================================================================
--- cpu/x86/pc/biosload/callvbe.fth	2009-02-20 09:14:16 UTC (rev 1107)
+++ cpu/x86/pc/biosload/callvbe.fth	2009-02-20 09:17:56 UTC (rev 1108)
@@ -9,12 +9,12 @@
    d# 16 [ax]  bx  mov  \ COM32 intcall helper function
    d# 20 [ax]  dx  mov  \ bounce buffer address
 
-   4f02 #  d# 36 [dx]  mov  \ AX
+   h# 4f02 #  d# 36 [dx]  mov  \ AX
    cx      d# 24 [dx]  mov  \ BX
 
-   \ dx push
-   0 # push
    dx push
+\   0 # push
+   dx push
    h# 10 # push
 
    bx call
@@ -22,3 +22,118 @@
 
    bp pop  di pop  si pop
 c;
+
+: +c32-regs  ( offset -- adr )  0 @  d# 20 + @  +  ;
+: 'c32-gs  ( -- adr )  0 +c32-regs  ;
+: 'c32-fs  ( -- adr )  2 +c32-regs  ;
+: 'c32-es  ( -- adr )  4 +c32-regs  ;
+: 'c32-ds  ( -- adr )  6 +c32-regs  ;
+
+: 'c32-di  ( -- adr )  d#  8 +c32-regs  ;
+: 'c32-si  ( -- adr )  d# 12 +c32-regs  ;
+: 'c32-bp  ( -- adr )  d# 16 +c32-regs  ;
+: 'c32-bx  ( -- adr )  d# 24 +c32-regs  ;
+: 'c32-dx  ( -- adr )  d# 28 +c32-regs  ;
+: 'c32-cx  ( -- adr )  d# 32 +c32-regs  ;
+: 'c32-ax  ( -- adr )  d# 36 +c32-regs  ;
+: 'c32-eflags  ( -- adr )  d# 40 +c32-regs  ;
+
+code c32-intcall  ( int# -- )
+   cx pop
+
+   si push  di push  bp push
+   0 #)  ax mov  \ Pointer to COM32 args
+   d# 16 [ax]  bx  mov  \ COM32 intcall helper function
+   d# 20 [ax]  dx  mov  \ bounce buffer address
+
+   dx push
+\   0 # push
+   dx push
+   cx push   \ Int#
+
+   bx call
+   ax pop  ax pop  ax pop
+
+   bp pop  di pop  si pop
+c;
+
+: vbe-call  ( function# -- )
+  'c32-ax l!  h# 10 c32-intcall
+  'c32-ax l@  h# 4f <>  abort" VESA BIOS call failed"
+;
+
+: c32-es:di!  ( adr -- )  >seg:off  'c32-es w!  'c32-di w!  ;
+: vbe-info  ( -- adr )
+   h# 200 +c32-regs    ( adr )
+   h# 32454256 over l! ( adr )
+   c32-es:di!
+   h# 4f00 vbe-call
+   h# 200 +c32-regs      ( adr )
+;   
+: .vesa-modes  ( -- )
+   vbe-info                     ( adr )
+   dup l@  h# 41534556 <>  if   ( adr )
+      ." VBE info call failed" cr
+      drop exit
+   then                         ( adr )
+   dup 6 + seg:off@  .cstr cr   ( adr )
+   d# 14 + seg:off@             ( 'mode-list )
+   begin  dup w@ dup h# ffff <>  while  .  wa1+  repeat  cr  2drop
+;
+: vesa-mode-info  ( mode# -- adr )
+   'c32-cx l!                   ( )
+   h# 200 +c32-regs c32-es:di!  ( )
+   h# 4f01 vbe-call             ( )
+   h# 200 +c32-regs             ( adr )
+;
+
+[ifdef] Commentary
+00.w mode attributes
+02.b wina attributes
+03.b winb attributes
+04.w winGranularity
+06.w WinSize
+08.w WinASegment
+0a.w WinBSegment
+0c.l WinFuncPtr
+10.w BytesPerScanLine
+12.w XResolution
+14.w YResolution
+16.b XCharSize
+17.b YCharSize
+18.b NumberOfPlanes
+19.b BitsPerPixel
+1a.b NumberOfBanks
+1b.b MemoryModel
+1c.b BankSize
+1d.b NumberOfImagePlanes
+1e.b Reserved
+1f.b RedMaskSize
+20.b RedFieldPosition
+21.b GreenMaskSize
+22.b GreenFieldPosition
+23.b BlueMaskSize
+24.b BlueFieldPosition
+25.b RsvdMaskSize
+26.b RsvdFieldPosition
+27.b DirectColorModeInfo
+\ Following are VBE 2.0 and above
+28.l PhysBasePtr
+2c.l Reserved
+30.w Reserved
+\ Following are VBE 3.0 and above
+32.w LinBytesPerScanLine
+34.b BnkNumberOfImagePages
+35.b LinNumberOfImagePages
+36.b LinRedMaskSize
+37.b LinRedFieldPosition
+38.b LinGreenMaskSize
+39.b LinGreenFieldPosition
+3a.b LinBlueMaskSize
+3b.b LinBlueFieldPosition
+3c.b LinRsvdMaskSize
+3d.b LinRsvdFieldPosition
+3e.l MaxPixelClock 
+[then]
+
+: current-vesa-mode  ( -- mode# )  h# 4f03 vbe-call  'c32-bx l@  ;

Modified: cpu/x86/pc/biosload/fw.bth
===================================================================
--- cpu/x86/pc/biosload/fw.bth	2009-02-20 09:14:16 UTC (rev 1107)
+++ cpu/x86/pc/biosload/fw.bth	2009-02-20 09:17:56 UTC (rev 1108)
@@ -226,6 +226,10 @@
 fload ${BP}/cpu/x86/pc/biosload/callbios.fth
 \ fload ${BP}/cpu/x86/pc/biosload/rmenter.fth
 
+[ifdef] syslinux-loaded
+fload ${BP}/cpu/x86/pc/biosload/callvbe.fth
+[then]
+
 \ false to stand-init-debug?
 true to stand-init-debug?
 

Modified: cpu/x86/pc/olpc/iflash.fth
===================================================================
--- cpu/x86/pc/olpc/iflash.fth	2009-02-20 09:14:16 UTC (rev 1107)
+++ cpu/x86/pc/olpc/iflash.fth	2009-02-20 09:17:56 UTC (rev 1108)
@@ -22,6 +22,7 @@
    /mfg-data-merge move
 ;
 
+[ifdef] get-mfg-data
 \ unpollute-mfg-data clears the Insyde BIOS residue from the beginning
 \ of the manufacturing data area, restoring it to erased state
 : unpollute-mfg-data  ( -- )
@@ -30,6 +31,7 @@
    mfg-data-buf mfg-data-merge-offset h# ff fill
    put-mfg-data
 ;
+[then]
 
 : get-insyde  ( ["filename"] -- )
    parse-word   ( adr len )




More information about the openfirmware mailing list