home .. forth .. colorforth mail list archive ..

Re: [colorforth] Booting from HDD


On Sat, Mar 15, 2008 at 5:25 PM, Ray St. Marie <ray.stmarie@xxxxxxxxx> wrote:
>
> On Sat, Mar 15, 2008 at 3:37 PM, Nick Maroudas
> <alice@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > Dear John,
> >
> > Thanks for setting me right re P9492. I was way off.
> > Might I ask you kindly, as the author of that version,
> > also to set me right on what instruction or opcode
> > stands at 0x92 bytes into the bootloader? By my crude
> > reckoning (based on Tim's  NASM cmcolor.list.txt) if
> > "org7c00" is 0x00 then 0x92 has already set up the
> > video mode (presumably AGP) copied all the blocks
> > (presumably not via floppy :) and stands at
> > "relocate:".  Is this anywhere near your mark?
> >
> > Caritas,
> >
> > NickM
> >
> >
> > Quoting John Comeau <jc@xxxxxxxxxxxx>:
> >
> > >... " P9492: 'P' is protected mode, 9492 is the last
> >
> > >... " hex address just past
> > >... " which one of the debugging calls was executed.
> > >... " If I remember right,
> > >... " that version starts at 0x9400, so it's only 0x92
> > >... " bytes into the
> > >... " bootloader.
> > >... "
> > >... " On Sat, Mar 15, 2008 at 4:59 AM, Jason Kemp
> > >... " <jason.kemp@xxxxxxxxxxxxxxxx> wrote:
> > >... " > Dear Nick,
> > >... " >
> > >... " >  Sorry, I sent this yesterday but it's been
> > >... " bounced back.
> > >... " >
> > >... " >  It doesn't boot from a flash drive.
> > >... " >
> > >... " >  The board has a Phoenix BIOS and it
> > >... " identifies a USB flash drive in the
> > >... " >  BIOS setup as "USB-HDD0" so I assume it is
> > >... " emulating a hard disk--in
> > >... " >  fact I had the same flash drive running
> > >... " FreeDOS before (so I could run
> > >... " >  Pygmy) and DOS saw it as the C: drive.  So if
> > >... " it's emulating a HDD then
> > >... " >  I expect that is why colorForth Won't boot
> > >... " fully--it displays "P9492" in
> > >... " >  the top right though, which I assume is from
> > >... " the progress routine in
> > >... " >  boot.asm.  Lots of guessing and assuming at
> > >... " the mo!
> > >... " >
> > >... " >  Just a brief Google of USB Flash booting and
> > >... " it appears that in some AMI
> > >... " >  BIOSes give a forced FDD emulation option.
> > >... " >
> > >... " >  Jason
> > >... " >
> > >... " >  Nick Maroudas said the following on
> > >... " 14/03/2008 20:36:
> > >... " >
> > >... " >
> > >... " > > Dear Jason,
> > >... " >  >
> > >... " >  > Looking forward to more from you and John
> > >... " Comeau, on how
> > >... " >  > to boot (and save?) with his iso on your
> > >... " flash drive.
> > >... " >  >
> > >... " >  > Re your not finding a version that works on
> > >... " a 3GHz P4,
> > >... " >  > I
> > >... " >  > have the same experience with 3.3 GHz PD on
> > >... " Intel945
> > >... " >  > board. None of the following booted
> > >... " properly - not
> > >... " >  > John's CD of CFDOS4, nor floppies with
> > >... " Chuck's CF01,
> > >... " >  > nor the Neitz/StMarie CF01, nor Josh's CF05
> > >... " and a
> > >... " >  > related CF05 from Ray - though every one of
> > >... " these ran
> > >... " >  > reliably on my 0.55 GHz P4/ASUS P2. However
> > >... " (to my
> > >... " >  > relief!) Howerd Oakford's CFDOS4 (from
> > >... " Howerd's
> > >... " >  > website)
> > >... " >  > runs on both the old and the new machine.
> > >... " >  >
> > >... " >  > http://www.inventio.co.uk/
> > >... " >  >
> > >... " >  > Scratching around for a possible reason, I
> > >... " found JC's
> > >... " >  > meticulous comparison View of
> > >... " >  > /colorforth/boot_asm_list.txt on
> > >... " SourceForge.net.
> > >... " >  > According to my understanding of John's
> > >... " list, number 11
> > >... " >  > is the only one for sure that "has VESA
> > >... " code instead of
> > >... " >  > AGP" - VESA/VBE being the new standard for
> > >... " graphics
> > >... " >  > software of course.
> > >... " >  > JC lists number 11 as
> > >... " "/usr/src/howerd/VESA/boot.asm"
> > >... " >  > but no. 10 is also by Howerd
> > >... " >  > "/usr/src/howerd/Quartus/BOOT.ASM # same as
> > >... " Kris
> > >... " >  > Johnson's"
> > >... " >  > so I am not sure which boot.asm is used to
> > >... " boot Howerd's
> > >... " >  > floppy, and which one is used to boot
> > >... " John's CD (and
> > >... " >  > your USB flash drive). But if VESA code
> > >... " does indeed
> > >... " >  > turn out to be crucial for some newer
> > >... " machines, then I
> > >... " >  > shall owe it to JC's method for spotting
> > >... " the difference
> > >... " >  > :-)
> > >... " >  >
> > >... " >  > Caritas,
> > >... " >  >
> > >... " >  > NickM
> > >... " >  >
> > >... " >  >
> > >... " >  > Quoting Jason Kemp
> > >... " <jason.kemp@xxxxxxxxxxxxxxxx>:
> > >... " >  >
> > >... " >  >
> > >... " >  >> ... " It's fine on the Jetway
> > >... " >  >> ... " It doesn't work on my old Gateway
> > >... " SOLO2150 which
> > >... " >  >> ... " runs the original CF01
> > >... " >  >> ... " and Josh Grams's CF05
> > >... " >  >> ... " So far nothing runs on my Asrock
> > >... " P4i64G 3GHz P4;
> > >... " >  >> ... " anyway, I will try it again and pay
> > >... " more
> > >... " >  >> ... " attention if you wish.
> > >... " >  >> ... "
> > >... " >  >> ... " I will try booting from a flash
> > >... " drive later on
> > >... " >  >> ... " the Jetway too.
> > >... " >  >> ... "
> > >... " >  >> ... " Jason
> > >... " >  >> ... "
> > >... " >  >>
> > >... " >  >
> > >... " >  >
> > >... "
> > ---------------------------------------------------------------------
> > >... " >  > To unsubscribe, e-mail:
> > >... " colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> > >... " >  > For additional commands, e-mail:
> > >... " colorforth-help@xxxxxxxxxxxxxxxxxx
> > >... " >  > Main web page - http://www.colorforth.com
> > >... " >  >
> > >... " >  >
> > >... " >  >
> > >... " >  >
> > >... " >
> > >... " >
> > >... " >
> > >... "
> > ---------------------------------------------------------------------
> > >... " >  To unsubscribe, e-mail:
> > >... " colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> > >... " >  For additional commands, e-mail:
> > >... " colorforth-help@xxxxxxxxxxxxxxxxxx
> > >... " >  Main web page - http://www.colorforth.com
> > >... " >
> > >... " >
> > >... "
> > >... "
> > >... "
> > >... " --
> > >... " John Comeau <jc@xxxxxxxxxxxx>
> > >... " http://jc.unternet.net/
> > >... " "A place for everything, and everything
> > >... " all over the place"
> > >... "
> > >... "
> > ---------------------------------------------------------------------
> > >... " To unsubscribe, e-mail:
> > >... " colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> > >... " For additional commands, e-mail:
> > >... " colorforth-help@xxxxxxxxxxxxxxxxxx
> > >... " Main web page - http://www.colorforth.com
> > >... "
> >
> >
> > --
> > Dr Nicolas George Maroudas
> > Avigdor Meiri 9/1
> > Sea View
> > Haifa 3 55 00
> > Israel
> > Tel +972 048 337 315
> >
> > ****************************
> >
> > No trees were killed in the sending of this message.
> > However, a large number of electrons were terribly
> > inconvenienced
> >
> > ****
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
> > For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
> > Main web page - http://www.colorforth.com
> >
> >
>
> Hi Nick, All!
>
> Far as I can tell from my listing of Terry's 800x600 version of
> Chuck's 01 with Terry's floppy strobe, where I returned all of the
> margins and fonts and video mode to 4117 ( 1024x768 5:6:5 color with
> linear frame buffer bit set) ...
>
> 0x92h is were the jump instruction 0xeah is inserted in the relocate
> code and is the jump to protected mode, far as I can tell.
>
> --
> Raymond St. Marie ii,
> colorforthray.info
>

Microsoft (R) Macro Assembler Version 6.14.8444		    10/12/07 23:04:39
color.asm						     Page 1 - 1


				;colorForth, 2001 Jul 22, Chuck Moore, Public Domain
				;modified 8/06/01 for 800x600 operation Terry Loveall, loveall@xxxxxxxxx
				;modified ras20040728 returned to 1024x768 operation for the pentium 4
				;by Ray St. Marie Rastm2@xxxxxxxxxxxxxxxxxxxxx
				.MODEL tiny
				.486p
 00000000			only SEGMENT USE32
				ASSUME DS:only

				next MACRO adr
				    dec  ECX
				    jnz  adr
				ENDM

				DUP_ MACRO
				    lea  ESI, [ESI-4]
				    mov  [ESI], EAX
				ENDM

				DROP MACRO
				    lodsd
				ENDM

				;;hp equ 800
				;;vp equ 600
				;;vesa equ 114h
 = 00000400			hp equ 1024
 = 00000300			vp equ 768
 = 00004117			vesa equ 4117h ; 117h but with LinearFrameBuffer Bit on
 = 00025C00			buffer equ 604*256
				include boot.asm ; boot boot0 hard
			      C ; Floppy boot segment
			      C
			      C org 0 ; actually 7c00
 00000000  EB 56	      C start: jmp  start0
 00000002  90		      C     nop
			      C
 00000003  63 6D 63 66 20     C     db 'cmcf 1.0'
	   31 2E 30
 0000000B  0200		      C     dw 512     ; bytes/sector
 0000000D  01		      C     db 1       ; sector/cluster
 0000000E  0001		      C     dw 1       ; sector reserved
 00000010  02		      C     db 2       ; FATs
 00000011  00E0		      C     dw 16*14   ; root directory entries
 00000013  0B40		      C     dw 80*2*18 ; sectors
 00000015  F0		      C     db 0F0h    ; media
 00000016  0009		      C     dw 9       ; sectors/FAT
 00000018  0012		      C     dw 18      ; sectors/track
 0000001A  0002		      C     dw 2       ; heads
 0000001C  00000000	      C     dd 0       ; hidden sectors
 00000020  00000B40	      C     dd 80*2*18 ; sectors again
 00000024  00		      C     db 0       ; drive
			      C ;    db 0
			      C ;    db 29h     ; signature
			      C ;    dd 44444444h     ; serial
			      C ;    db 'COLOR FORTH' ; label
			      C ;    db '        '
			      C
 00000025 00		      C command  db 0
 00000026  00		      C          db 0   ; head, drive
 00000027 00		      C cylinder db 0
 00000028  00		      C          db 0   ; head
 00000029  01		      C          db 1   ; sector
 0000002A  02		      C          db 2   ; 512 bytes/sector
 0000002B  12		      C          db 18  ; sectors/track
 0000002C  1B		      C          db 1bh ; gap
 0000002D  FF		      C          db 0ffh
			      C ALIGN 4
 00000030 00000012	      C nc dd 18 ; Forth+Icons+blocks 24-161
 00000034 0017		      C gdt dw 17h
 00000036  00000040 R	      C     dd offset gdt0
			      C ALIGN 8
 00000040 0000 0000 0000      C gdt0 dw 0, 0, 0, 0
	   0000
 00000048  FFFF 0000 9A00     C     dw 0FFFFh, 0, 9A00h, 0CFh ; code
	   00CF
 00000050  FFFF 0000 9200     C     dw 0FFFFh, 0, 9200h, 0CFh ; data
	   00CF
			      C
			      C ; Code is compiled in Protected 32-bit mode.
			      C ; Hence  org $-2  to fix 16-bit words
			      C ; and 4 hand-assembled instructions.
			      C ; and EAX and AX exchanged
			      C ; This code is in Real 16-bit mode
			      C
 00000058  B8 00004F02	      C start0: mov  EAX, 4F02h ; Video mode
			      C org $-2
 0000005B  BB 00004117	      C     mov  EBX, vesa ; hp*vp rgb: 565
			      C org $-2
 0000005E  CD 10	      C     int  10h
 00000060  FA		      C     cli
 00000061  66| 33 C0	      C     xor  AX, AX    ; Move code to 0
 00000064  66| 8B D8	      C     mov  BX, AX
 00000067  8C CB	      C     mov  EBX, CS
 00000069  8E DB	      C     mov  DS, EBX
 0000006B  8E C0	      C     mov  ES, EAX
 0000006D  66| 8B F8	      C     mov  DI, AX
 00000070  66| 8B F0	      C     mov  SI, AX
 00000073  E8 00000000	      C     call $+5 ; Where are we? IP+4*CS
			      C org $-2
 00000076  5E		      C loc: pop  ESI
 00000077  81 EE 00000076     C     sub  ESI, offset loc-offset start
			      C org $-2
 0000007B  B9 00000080	      C     mov  ECX, 512/4
			      C org $-2
 0000007E  F3/ 66| A5	      C     rep movsw
			      C ;    jmp  0:relocate
 00000081  EA		      C     db 0eah
 00000082  0086 0000	      C     dw offset relocate-offset start, 0
			      C
 00000086		      C relocate: ; This code is executed from 0
 00000086  8E D8	      C     mov  DS, EAX
			      C ;   lgdt fword ptr gdt
 00000088  0F 01 16	      C     db 0fh, 1, 16h
 0000008B  0034		      C     dw offset gdt-offset start
 0000008D  B0 01	      C     mov  AL, 1
 0000008F  0F 22 C0	      C     mov  CR0, EAX
			      C ;    jmp  8:protected
 00000092  EA		      C     db 0eah
 00000093  0097 0008	      C     dw offset protected-offset start, 8
			      C
 00000097		      C protected: ; Now in Protected 32-bit mode
 00000097  B0 10	      C     mov  AL, 10h
 00000099  8E D8	      C     mov  DS, EAX
 0000009B  8E C0	      C     mov  ES, EAX
 0000009D  8E D0	      C     mov  SS, EAX
 0000009F  BC 000A0000	      C     mov  ESP, Gods
 000000A4  33 C9	      C     xor  ECX, ECX
			      C

-- 
Raymond St. Marie ii,
colorforthray.info

---------------------------------------------------------------------
To unsubscribe, e-mail: colorforth-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: colorforth-help@xxxxxxxxxxxxxxxxxx
Main web page - http://www.colorforth.com