From mika.nizar at mail.ru Wed Sep 16 17:49:03 2015 From: mika.nizar at mail.ru (=?UTF-8?B?TklaQVIgTUFBUk9VRkk=?=) Date: Wed, 16 Sep 2015 20:49:03 +0300 Subject: [openfirmware] =?utf-8?q?Any_tuto_how_to_erase_my_current_ROM_and?= =?utf-8?q?_install_the_OPEN_Bios_=3F?= Message-ID: <1442425743.843960618@f303.i.mail.ru> Can the Open Bios actually replace the AMI on my Intel Machine ? if yes, please lead me to the closest tuto for help thank you -------------- next part -------------- An HTML attachment was scrubbed... URL: From svn at openfirmware.info Thu Sep 17 08:22:34 2015 From: svn at openfirmware.info (repository service) Date: Thu, 17 Sep 2015 08:22:34 +0000 Subject: [openfirmware] [commit] r3781 - cpu/arm cpu/x86 forth/kernel forth/lib forth/wrapper/zip Message-ID: Author: quozl Date: Thu Sep 17 08:22:33 2015 New Revision: 3781 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3781 Log: Preparations for a 64-bit implementation Modified: cpu/arm/debugm.fth cpu/x86/debugm.fth cpu/x86/kerncode.fth forth/kernel/forward.fth forth/kernel/kernel.fth forth/kernel/metacompile.fth forth/lib/debug.fth forth/lib/loadcomm.fth forth/lib/strcase.fth forth/wrapper/zip/inflate.c Modified: cpu/arm/debugm.fth ============================================================================== --- cpu/arm/debugm.fth Wed Jul 15 23:07:22 2015 (r3780) +++ cpu/arm/debugm.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -13,7 +13,7 @@ nuser 'debug \ code field for high level trace nuser \ upper limit of ip -nuser cnt \ how many times thru debug next +nuser cntx \ how many times thru debug next \ Since we use a shared "next" routine, slow-next and fast-next are no-op's alias slow-next 2drop ( high low -- ) @@ -30,13 +30,13 @@ ldr r0,'user ip> cmp ip,r0 u< if - ldr r0,'user cnt + ldr r0,'user cntx inc r0,#1 - str r0,'user cnt + str r0,'user cntx cmp r0,#2 = if mov r0,#0 - str r0,'user cnt + str r0,'user cntx adr r0,'body normal-next str r0,'user debug-next ldr pc,'user 'debug Modified: cpu/x86/debugm.fth ============================================================================== --- cpu/x86/debugm.fth Wed Jul 15 23:07:22 2015 (r3780) +++ cpu/x86/debugm.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -9,7 +9,7 @@ nuser 'debug \ code field for high level trace nuser \ upper limit of ip -nuser cnt \ how many times thru debug next +nuser cntx \ how many times thru debug next label _flush_cache ( -- ) ret @@ -58,13 +58,13 @@ u>= if 'user ip> ip cmp u< if - 'user cnt ax mov + 'user cntx ax mov ax inc - ax 'user cnt mov + ax 'user cntx mov 2 # ax cmp = if ax ax sub - ax 'user cnt mov + ax 'user cntx mov \ normal-next #) ax lea make-even \ word-align address \- rel normal-next dup #) ax lea Modified: cpu/x86/kerncode.fth ============================================================================== --- cpu/x86/kerncode.fth Wed Jul 15 23:07:22 2015 (r3780) +++ cpu/x86/kerncode.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -470,6 +470,8 @@ code 0> (s n -- f ) > unary-test c; code 0>= (s n -- f ) 0>= unary-test c; +: ?exit (s flag -- ) 0<> if exit then ; + assembler definitions :-h compare ax pop bx pop ax bx cmp Modified: forth/kernel/forward.fth ============================================================================== --- forth/kernel/forward.fth Wed Jul 15 23:07:22 2015 (r3780) +++ forth/kernel/forward.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -80,6 +80,13 @@ : resolved? ( acf -- flag ) \ true if already resolved resolution@ origin-t u> ; +: defined?-t \ name ( -- flag ) + safe-parse-word $sfind if + resolved? + else + 2drop false + then +; \ Words to manipulate the symbol table vocabulary at the end of compilation. Modified: forth/kernel/kernel.fth ============================================================================== --- forth/kernel/kernel.fth Wed Jul 15 23:07:22 2015 (r3780) +++ forth/kernel/kernel.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -395,7 +395,9 @@ : "move (s from-pstr to-pstr -- to-pstr ) >r count r> pack ; \ : count (s adr -- adr+1 len ) dup 1+ swap c@ ; +[ifndef]-t /string : /string ( adr len cnt -- adr' len' ) tuck - -rot + swap ; +[then] : printable? ( n -- flag ) \ true if n is a printable ascii character dup bl th 7f within swap th 80 th ff between or @@ -415,8 +417,12 @@ dup 0 ?do 2dup + 1- c@ white-space? 0= ?leave 1- loop ; +[ifndef]-t upper : upper (s adr len -- ) bounds ?do i dup c@ upc swap c! loop ; +[then] +[ifndef]-t lower : lower (s adr len -- ) bounds ?do i dup c@ lcc swap c! loop ; +[then] nuser caps : f83-compare (s adr adr2 len -- -1 | 0 | 1 ) @@ -523,9 +529,12 @@ cmove> drop ; +[ifndef]-t 2rot : 2rot (s a b c d e f -- c d e f a b ) 5 roll 5 roll ; - +[then] +[ifndef]-t ?dup : ?dup (s n -- [n] n ) dup if dup then ; +[then] : between (s n min max -- f ) >r over <= swap r> <= and ; : within (s n1 min max+1 -- f ) over - >r - r> u< ; @@ -628,7 +637,7 @@ \ needs to temporarily contain odd byte offset because of c, : here (s -- addr ) dp @ ; -fffffffc value limit +-4 value limit : unused ( -- #bytes ) limit here - ; defer allot-error @@ -709,7 +718,7 @@ \t16 compile (lit) , \t16 then -64\ \t32 dup -1 h# 0.ffff.fffe n->l between if +64\ \t32 dup 1+ d# 32 >> 0= if 64\ \t32 compile (llit) 1+ l, 64\ \t32 else \t32 compile (lit) , @@ -926,14 +935,17 @@ : numdelim? ( char -- flag ) dup ascii . = swap ascii , = or ; : $dnumber? ( adr len -- [ n .. ] #cells ) 0 0 2swap ( ud $ ) - dup 0= if 4drop 0 exit then ( ud $ ) + dup 0= if 4drop 0 exit then ( ud $ ) over c@ ascii - = ( ud $ neg? ) dup >r negate /string ( ud $' ) ( r: neg? ) + base @ >r ( ud $' ) ( r: neg? base ) + \ Recognize leading "0x" + over 2 " 0x" $= if hex 2 /string then \ Convert groups of digits possibly separated by periods or commas begin >number dup 1 > while ( ud' $' ) over c@ numdelim? 0= if ( ud' $' ) - r> 5drop 0 exit ( ud' $' ) + 2r> base ! 5drop 0 exit ( ud' $' ) then ( ud' $' ) 1 /string ( ud' $' ) repeat ( ud' $' ) @@ -944,12 +956,13 @@ c@ ascii . = if ( ud ) true ( ud dbl? ) else ( ud ) - r> 3drop 0 exit + 2r> base ! 3drop 0 exit then ( ud dbl? ) else ( ud adr ) drop false ( ud dbl? ) then ( ud dbl? ) + r> base ! over or if ( ud ) r> if dnegate then 2 else @@ -1142,7 +1155,8 @@ 64\ : 16\ [compile] \ ; immediate 64\ : 32\ [compile] \ ; immediate 64\ : 64\ ; immediate -[then] + +[then] \ run-time \ From definers.fth @@ -1170,7 +1184,9 @@ : ?csp (s -- ) sp@ csp @ <> ( -22 ) abort" Stack Changed " ; : (;code) (s -- ) ip> aligned acf-aligned used ; -: (does>) (s -- ) ip> acf-aligned used ; +64\ : (does>) (s -- ) ip> aligned used ; +32\ : (does>) (s -- ) ip> acf-aligned used ; +16\ : (does>) (s -- ) ip> acf-aligned used ; defer do-entercode ' noop is do-entercode @@ -1188,7 +1204,11 @@ : c; ( -- ) next end-code ; : ;code (s -- ) - ?csp compile (;code) align acf-align place-;code + ?csp compile (;code) +16\ align acf-align +32\ align acf-align +64\ acf-align + place-;code [compile] [ reveal do-entercode ; immediate @@ -1196,9 +1216,13 @@ state @ if compile (does>) else - here aligned acf-aligned used !csp not-hidden ] +16\ here aligned acf-aligned used !csp not-hidden ] +32\ here aligned acf-aligned used !csp not-hidden ] +64\ here aligned used !csp not-hidden ] then - align acf-align place-does +16\ align acf-align place-does +32\ align acf-align place-does +64\ align place-does ; immediate : : (s -- ) ?exec !csp header hide ] colon-cf ; @@ -1279,14 +1303,13 @@ headers : do-buffer ( apf -- adr ) - dup >user @ if ( apf ) - >user @ ( adr ) - else ( apf ) - dup /user# + @ ( apf size ) - dup alloc-mem ( apf size adr ) - dup rot erase ( apf adr ) - dup rot >user ! ( adr ) - then + dup >user @ ?dup ( apf adr adr | apf 0 ) + if nip exit then ( apf ) + \ Must use unaligned-@ here, since /user# != /n on all machines. + dup /user# + unaligned-@ ( apf size ) + dup alloc-mem ( apf size adr ) + dup rot erase ( apf adr ) + dup rot >user ! ( adr ) ; : (buffer:) ( size -- ) create-cf make-buffer does> do-buffer @@ -1474,6 +1497,27 @@ : vocabulary ( "name" -- ) header (wordlist) ; defer $find-next + +[ifndef]-t ($find-next) +\ Generic colon definition version of ($find-next). This is guaranteed +\ to be suboptimal in almost all cases, but it's useful before you start +\ writing and debugging accelerated versions. +\ 'link' is an address in a vocaulary containing the token (of the +\ acf) of the newest definition +: ($find-next) ( adr len link -- adr len alf true | adr len false ) + begin + link@ dup origin <> ( adr len acf more? ) + while + >link >r r@ l>name name>string ( target$ this$ R:alf ) + 2over $= if + r> true exit + then + r> + repeat + drop false +; +[then] + ' ($find-next) is $find-next \ : insert-after ( new-node old-node -- ) @@ -2000,9 +2044,8 @@ : line-delimiter file @ 17 na+ ; \ The last delimiter at the end of each line : pre-delimiter file @ 18 na+ ; \ The first line delimiter (if any) : (file-name) file @ 19 na+ ; \ The name of the file -/n round-up headers -20 /n-t * d# 68 + constant /fd +d# 20 /n-t * d# 68 + /n-t round-up constant /fd : set-name ( adr len -- ) \ If the name is too long, cut off initial characters (because the Modified: forth/kernel/metacompile.fth ============================================================================== --- forth/kernel/metacompile.fth Wed Jul 15 23:07:22 2015 (r3780) +++ forth/kernel/metacompile.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -9,7 +9,7 @@ \ Non-immediate version which is compiled inside several \ meta and transition words -: literal-t ( n -- ) n->l-t compile-t (lit) ,-t ; +: literal-t ( n -- ) n->n-t compile-t (lit) ,-t ; \ vocabularies: \ transition @@ -401,7 +401,7 @@ \ Automatic allocation of space in the user area variable #user-t -/n constant #ualign-t +/n-t constant #ualign-t : ualigned-t ( n -- n' ) #ualign-t 1- + #ualign-t negate and ; : ualloc-t ( n -- next-user-# ) \ allocate n bytes and leave a user number @@ -415,7 +415,9 @@ : isconstant ( acf -- n ) >body-t @-t ; : constant \ name ( n -- ) safe-parse-word 3dup $equ - " constant-cf" $header-t s->l-t ,-t +64\ " constant-cf" $header-t n->n-t ,-t +32\ " constant-cf" $header-t s->l-t ,-t +16\ " constant-cf" $header-t s->l-t ,-t ['] isconstant setaction ?debug ; @@ -425,7 +427,9 @@ ['] iscreate setaction ?debug ; -: isvariable ( n acf -- ) >body-t !-t ; +64\ : isvariable ( n acf -- ) >body-t >r n->n-t r> !-t ; +32\ : isvariable ( n acf -- ) >body-t !-t ; +16\ : isvariable ( n acf -- ) >body-t !-t ; : variable \ name ( -- ) " variable-cf" header-t 0 n->n-t ,-t ['] isvariable setaction ?debug @@ -489,7 +493,10 @@ \ of defining the label. : mlabel \ name ( -- ) ( Later: -- adr-t ) - safe-parse-word align-t acf-align-t $label + safe-parse-word align-t +32\ acf-align-t +16\ acf-align-t + $label ; : mloclabel \ name ( -- ) ( Later: -- adr-t ) safe-parse-word $label @@ -568,14 +575,20 @@ \ XXX the alignment should be done in startdoes; it is incorrect \ to assume that acf alignment is sufficient (code alignment might \ be stricter). - align-t acf-align-t here-t doestarget ! +64\ align-t here-t doestarget ! +32\ align-t acf-align-t here-t doestarget ! +16\ align-t acf-align-t here-t doestarget ! " startdoes" $meta-execute target ; immediate : ;code (s -- ) host - ?csp compile-t (;code) align-t acf-align-t here-t doestarget ! + ?csp compile-t (;code) +64\ acf-align-t +32\ align-t acf-align-t +16\ align-t acf-align-t + here-t doestarget ! " start;code" $meta-execute [compile] [ reveal-t entercode target @@ -669,6 +682,9 @@ ; meta definitions +: [ifdef]-t defined?-t [compile] [if] ; immediate-h +: [ifndef]-t defined?-t 0= [compile] [if] ; immediate-h + alias : :-t alias ] ]-t alias /n /n-t Modified: forth/lib/debug.fth ============================================================================== --- forth/lib/debug.fth Wed Jul 15 23:07:22 2015 (r3780) +++ forth/lib/debug.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -42,7 +42,7 @@ : force-redisplay ( -- ) -1 to displayed-xt ; : (debug) (s low-adr hi-adr -- ) - unbug 1 cnt ! ip> ! ! ! 1 cnt ! false endof + ascii < of the-ip ta1+ set- ! 1 cntx ! false endof ascii * of the-ip find-cfa dup ! false endof ascii \ of show-rstack @ 0= show-rstack ! false endof \ toggle return stack display ascii X of hex-stack @ 0= hex-stack ! false endof \ toggle heX stack display Modified: forth/lib/loadcomm.fth ============================================================================== --- forth/lib/loadcomm.fth Wed Jul 15 23:07:22 2015 (r3780) +++ forth/lib/loadcomm.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -24,6 +24,7 @@ fload ${BP}/forth/lib/strings.fth fload ${BP}/forth/lib/stringop.fth +fload ${BP}/forth/lib/string-tools.fth fload ${BP}/forth/lib/fastspac.fth Modified: forth/lib/strcase.fth ============================================================================== --- forth/lib/strcase.fth Wed Jul 15 23:07:22 2015 (r3780) +++ forth/lib/strcase.fth Thu Sep 17 08:22:33 2015 (r3781) @@ -9,7 +9,7 @@ \ " abc" $of ." The string starts with abc" $endof \ " xyz" $of ." Oh, it's an xyz string" $endof \ ( $ ) ." **** It was " 2dup type -\ $endcase ( $ ) +\ $endcase \ The default clause is optional. \ When an $of clause is executed, the remaining selector string (past @@ -28,15 +28,36 @@ \needs substring? fload ${BP}/forth/lib/substrin.fth -: ($of) ( arg$ sel$ -- arg$' ) - 4dup 2swap substring? if - nip /string - r> cell+ >r \ Return to next word in $of clause +\ Copying standard words here so they can be case insensitive: +: u$= (s adr1 len1 adr2 len2 -- same? ) + rot tuck <> if 3drop false exit then ( adr1 adr2 len1 ) + caps-comp 0= +; + +: usubstring? ( adr1 len1 adr2 len2 -- flag ) + rot tuck ( adr1 adr2 len1 len2 len1 ) + < if 3drop false else tuck u$= then +; + +: ($of) ( $selector $test -- [$selector] ) + 2over $= if + 2drop + r> /token + >r \ Return to next word in $of clause else + r> dup branch@ + >r \ Skip to matching $endof + then +; +: ($sub) ( $selector $test -- $selector | $rest ) + 4dup 2swap usubstring? if ( $selector $test ) + nip /string ( $rest ) + r> /token + >r \ Return to next word in $sub clause + else ( $selector $test ) 2drop - r> dup @ + >r \ Skip to matching $endof + r> dup branch@ + >r \ Skip to matching $endof then ; +: $sub ( -- >m ) ['] ($sub) +>mark ; immediate +: $endsub ( >m -- ) ['] ($endof) +>mark but ->resolve ; immediate : $case ( -- 0 ) +level 0 ; immediate : $of ( -- >m ) ['] ($of) +>mark ; immediate Modified: forth/wrapper/zip/inflate.c ============================================================================== --- forth/wrapper/zip/inflate.c Wed Jul 15 23:07:22 2015 (r3780) +++ forth/wrapper/zip/inflate.c Thu Sep 17 08:22:33 2015 (r3781) @@ -269,7 +269,7 @@ } } else { - int i; /* temporary variables */ + int i = 0; /* temporary variables */ struct huft *tl; /* literal/length code table */ struct huft *td; /* distance code table */ int bl; /* lookup bits for tl */ From svn at openfirmware.info Wed Sep 30 07:07:05 2015 From: svn at openfirmware.info (repository service) Date: Wed, 30 Sep 2015 07:07:05 +0000 Subject: [openfirmware] [commit] r3782 - forth/lib Message-ID: Author: quozl Date: Wed Sep 30 07:07:04 2015 New Revision: 3782 URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3782 Log: Add missing file from r3781, thanks to Marcin Cieslak for advising. Added: forth/lib/string-tools.fth Added: forth/lib/string-tools.fth ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ forth/lib/string-tools.fth Wed Sep 30 07:07:04 2015 (r3782) @@ -0,0 +1,39 @@ +\ string tools +\ make it easy to include numbers in strings +\ avoid $cat2 $cat3 which leak memory + +\ These words work with a pre-allocated string buffer. +\ Each buffer begins with its current count and ends with a null byte. +\ Unless we need larger strings, those will be 1 byte each. +\ The buddy allocator gives us 2^n bytes, so we will limit string size to 256-2=254 bytes. + +d# 254 constant maxstring +\ buf: len data +: string: ( -- ) create 256 allot ; +string: string1 + +\ name$ means an address/length pair on the stack +\ $name is a word that takes a string and maybe more arguments +: $room ( buffer -- room ) maxstring swap c@ - ; +: string$ ( buffer -- string$ ) count ; +: $add ( string$ buffer -- ) + >r + r@ $room over < abort" string will not fit " ( string$ ) + r> $cat +; +: $addch ( ch buffer -- ) >r r@ c@ r@ + 1+ c! 1 r@ c@ + r> c! ; +: $empty ( buffer -- ) 0 swap c! ; +: $place ( string$ buffer -- ) dup $empty $add ; +: $prepend ( string$ buffer -- ) \ $len == string$ length, blen == buffer length + >r dup r@ 1+ r@ 1+ rot + r@ c@ ( $ buf+1 buf+1+$len blen ) cmove> + r@ 1+ swap ( ready to do a cmove ) + ( $len ) dup r@ c@ + r> c! + ( adr buf+1 $len ) cmove +; +: $add_ ( buffer -- ) " " rot $add ; +: $add#_ ( n buffer -- ) >r (.) r@ $add r> $add_ ; +: $addd#_ ( n buffer -- ) >r push-decimal (.) pop-base r@ $add r> $add_ ; +: $addh#_ ( n buffer -- ) >r push-hex (u.) pop-base r@ $add r> $add_ ; +: $add8h# ( n buffer -- ) >r push-hex (.8) pop-base r> $add ; +: $add0x#_ ( n buffer -- ) >r " 0x" r@ $add r> $addh#_ ; + From saper at saper.info Wed Sep 30 10:04:36 2015 From: saper at saper.info (Marcin Cieslak) Date: Wed, 30 Sep 2015 10:04:36 +0000 Subject: [openfirmware] Troubleshooting VGA under qemu? Message-ID: Hello, I have tried running ofw without BIOS (as per http://www.openfirmware.info/Building_OFW_for_QEMU) and it seems that VGA support does not work. I am using config-virtualbox.fth as advised. I have uncommented "console-serial" in config.fth to be able to interact with the console and run: qemu-system-i386 -m 32 -bios emuofw.rom -hda fat:. -serial stdio (this qemu 2.4.0 on FreeBSD/amd64) "show-devs" reports (this is with video.fc included) ok show-devs /cpus /dropin-fs /flash at fff80000 /pci /dropin-fs /mmu /memory at 0 /aliases /options /openprom /chosen /packages /cpus/cpu at 0 /pci/ethernet at 3 /pci/display at 2 /pci/pci8086,7113 at 1,3 /pci/pci-ide at 1,1 /pci/host at 0 /pci/isa at 1 /pci/pci-ide at 1,1/ide at 1 /pci/pci-ide at 1,1/ide at 0 /pci/pci-ide at 1,1/ide at 1/cdrom at 0 /pci/pci-ide at 1,1/ide at 0/disk at 0 /pci/isa at 1/ide-controller at i1f0 /pci/isa at 1/sound at i220 /pci/isa at 1/rtc at i70 /pci/isa at 1/8042 at i60 /pci/isa at 1/fdc at i3f0 /pci/isa at 1/parallel at i378 /pci/isa at 1/serial at i2f8 /pci/isa at 1/serial at i3f8 /pci/isa at 1/timer at i40 /pci/isa at 1/interrupt-controller at i20 /pci/isa at 1/dma-controller at i00 /pci/isa at 1/ide-controller at i1f0/ide at 1 /pci/isa at 1/ide-controller at i1f0/ide at 0 /pci/isa at 1/ide-controller at i1f0/ide at 0/@0 /pci/isa at 1/8042 at i60/mouse at aux /pci/isa at 1/8042 at i60/keyboard at kbd /pci/isa at 1/fdc at i3f0/disk /packages/http /packages/tcp ... I have tried uncommenting in: ${BP}/dev/video/build/video.fc in cpu/x86/pc/emu/emuofw.bth as well as uncommenting create use-vga in cpu/x86/pc/emu/config.fth, none of which improves the situation. When I switch consoles in qemu the VGA screen says "Guest has not initialized the display (yet)" Any hints to troubleshoot this? Additional questions: 1) Would that be possible to have a dual-console mode (similar to what FreeBSD early bootloader has) so that both vga and serial console are active? ofw prints messages on the serial console even if disabled, only input is not working. 2) Initially I thought ofw is completely dead and I have run it under gdb, only to figure out I am running in the Forth inner interpreter: 0xff9fc000: lods %ds:(%esi),%eax => 0xff9fc001: jmp *(%eax) Is there any way to have "symbol table" to map word addresses to the word names? (I figured out I can tick the word to get its address). Thank you, Marcin From saper at saper.info Wed Sep 30 11:53:46 2015 From: saper at saper.info (Marcin Cieslak) Date: Wed, 30 Sep 2015 11:53:46 +0000 Subject: [openfirmware] Troubleshooting VGA under qemu? [patch] In-Reply-To: References: Message-ID: On Wed, 30 Sep 2015, Marcin Cieslak wrote: > Hello, > > I have tried running ofw without BIOS > (as per http://www.openfirmware.info/Building_OFW_for_QEMU) > and it seems that VGA support does not work. So, I got it working. The solution was: Index: cpu/x86/pc/emu/emuofw.bth =================================================================== --- cpu/x86/pc/emu/emuofw.bth (wersja 3782) +++ cpu/x86/pc/emu/emuofw.bth (kopia robocza) @@ -25,6 +25,7 @@ in: ${BP}/dev/video/build/vmsvga.fc in: ${BP}/dev/ne2000/build/ne2kpci.fc in: ${BP}/dev/amd79970/build/vmlance.fc +in: ${BP}/dev/video/build/bga.fc \ in: ${BP}/dev/video/build/video.fc in: ${BP}/cpu/x86/pc/biosload/linux.fth @@ -58,6 +59,7 @@ \ Just use a driver targeted at the specific chipset that QEMU emulates " ${BP}/dev/video/build/cirrus.fc" " pci1013,b8" $add-deflated-dropin " ${BP}/dev/video/build/vmsvga.fc" " pci15ad,405" $add-deflated-dropin + " ${BP}/dev/video/build/bga.fc" " pci1234,1111" $add-deflated-dropin " ${BP}/dev/ne2000/build/ne2kpci.fc" " pci10ec,8029" $add-deflated-dropin " ${BP}/dev/amd79970/build/vmlance.fc" " pci1022,2000" $add-deflated-dropin Newer QEMU offers Bochs VGA adapter ~Marcin From quozl at laptop.org Wed Sep 30 12:38:43 2015 From: quozl at laptop.org (James Cameron) Date: Wed, 30 Sep 2015 22:38:43 +1000 Subject: [openfirmware] Troubleshooting VGA under qemu? In-Reply-To: Message-ID: <20150930123843.GS8613@us.netrek.org> On Wed, Sep 30, 2015 at 10:04:36AM +0000, Marcin Cieslak wrote: > 1) Would that be possible to have a dual-console mode (similar to > what FreeBSD early bootloader has) so that both vga and serial > console are active? ofw prints messages on the serial console even > if disabled, only input is not working. I'm surprised serial console doesn't take input, but I haven't used OFW for QEMU for a long time. Add ofw/core/muxdev.fth to build? > 2) Initially I thought ofw is completely dead and I have run it > under gdb, only to figure out I am running in the Forth inner > interpreter: > > 0xff9fc000: lods %ds:(%esi),%eax > => 0xff9fc001: jmp *(%eax) > > Is there any way to have "symbol table" to map word addresses to the > word names? (I figured out I can tick the word to get its address). Nothing obvious springs to mind. A variant of "words" that prints addresses? A replacement of ":" that prints name and address during build? On Wed, Sep 30, 2015 at 11:53:46AM +0000, Marcin Cieslak wrote: > So, I got it working. > > The solution was: > > Index: cpu/x86/pc/emu/emuofw.bth > =================================================================== > --- cpu/x86/pc/emu/emuofw.bth (wersja 3782) > +++ cpu/x86/pc/emu/emuofw.bth (kopia robocza) > @@ -25,6 +25,7 @@ > in: ${BP}/dev/video/build/vmsvga.fc > in: ${BP}/dev/ne2000/build/ne2kpci.fc > in: ${BP}/dev/amd79970/build/vmlance.fc > +in: ${BP}/dev/video/build/bga.fc > \ in: ${BP}/dev/video/build/video.fc > in: ${BP}/cpu/x86/pc/biosload/linux.fth > > @@ -58,6 +59,7 @@ > \ Just use a driver targeted at the specific chipset that QEMU emulates > " ${BP}/dev/video/build/cirrus.fc" " pci1013,b8" $add-deflated-dropin > " ${BP}/dev/video/build/vmsvga.fc" " pci15ad,405" $add-deflated-dropin > + " ${BP}/dev/video/build/bga.fc" " pci1234,1111" $add-deflated-dropin > > " ${BP}/dev/ne2000/build/ne2kpci.fc" " pci10ec,8029" $add-deflated-dropin > " ${BP}/dev/amd79970/build/vmlance.fc" " pci1022,2000" $add-deflated-dropin > > > Newer QEMU offers Bochs VGA adapter Thanks. Want me to commit? Do you happen to know which version of QEMU switched to Bochs? -- James Cameron http://quozl.linux.org.au/ From saper at saper.info Wed Sep 30 13:31:31 2015 From: saper at saper.info (Marcin Cieslak) Date: Wed, 30 Sep 2015 13:31:31 +0000 Subject: [openfirmware] Troubleshooting VGA under qemu? In-Reply-To: <20150930123843.GS8613@us.netrek.org> References: <20150930123843.GS8613@us.netrek.org> Message-ID: On Wed, 30 Sep 2015, James Cameron wrote: > On Wed, Sep 30, 2015 at 10:04:36AM +0000, Marcin Cieslak wrote: > > 1) Would that be possible to have a dual-console mode (similar to > > what FreeBSD early bootloader has) so that both vga and serial > > console are active? ofw prints messages on the serial console even > > if disabled, only input is not working. > > Newer QEMU offers Bochs VGA adapter > > Thanks. Want me to commit? Would be good! > Do you happen to know which version of QEMU switched to Bochs? No idea. One can switch VGA adapters with -vga switch: -vga std -> Bochs adapter (1234:1111), seems to be the default -vga cirrus -> Cirrus (1013:00b8), also works -vga vmware -> VMWare (15ad:404) - DOES NOT WORK It seems that FCode gets detected, but the driver does not want to attach: Assigning PCI Space of length 10000 Memory Space... Base Reg: 2001030 = 11010000 Function:15ad Function: 405 Non FCode Format ROM Image. Checking for built-in FCode match for Vendor:15ad Device: 405 Checking for built-in FCode match... DROPIN NAME MATCH PCI PROBE-SELF: Phys.hi = 1800 Regarding "silent serial" problem - it occurs when "serial-console" is not defined and the VGA adapter does not attach (as it is the case for vmware now): One gets on the serial console this output: Install console Can't open output device. Generic PC, Serial #0, 32 MiB memory installed but ofw continues to print to the serial device as it did before, which is good. Maybe "Install console" step should still probe for the input device even if the output is broken? ~Marcin From saper at saper.info Wed Sep 30 13:52:27 2015 From: saper at saper.info (Marcin Cieslak) Date: Wed, 30 Sep 2015 13:52:27 +0000 Subject: [openfirmware] Troubleshooting VGA under qemu? In-Reply-To: References: <20150930123843.GS8613@us.netrek.org> Message-ID: On Wed, 30 Sep 2015, Marcin Cieslak wrote: > One gets on the serial console this output: > > Install console > Can't open output device. > Generic PC, Serial #0, 32 MiB memory installed This one was easy... input-device keyboard is active so one just needs to type "blindly" at the "AT keyboard" (in the QEMU graphical window) and the output goes to the serial console. Maybe using fallback devices would be less surprising, but this is not a bug. Marcin From saper at saper.info Wed Sep 30 18:38:14 2015 From: saper at saper.info (Marcin Cieslak) Date: Wed, 30 Sep 2015 18:38:14 +0000 Subject: [openfirmware] Copy paste bug in der! (PowerPC) Message-ID: There is a copy+paste bug: Index: cpu/ppc/spr.fth =================================================================== --- cpu/ppc/spr.fth (wersja 3782) +++ cpu/ppc/spr.fth (kopia robocza) @@ -426,7 +426,7 @@ mfspr tos,der c; code der! ( n -- ) - mtspr immr,tos + mtspr der,tos lwz tos,0(sp) addi sp,sp,1cell c;