Batch-file for compiling:
Code: Select all
@ECHO OFF
del *.obj
del testrun.exe
bc /o /Ot /Fs /G2 /Fpi /E /X boot\bootsect.bas;
ren bootsect.obj a.obj
link a,,nul,..\..\devel\bc7\lib\qbx.lib+..\..\devel\bc7\lib\bcl71efr.lib;
ren a.exe testrun.exe
del *.obj
Code: Select all
'$INCLUDE:'include/qbinux/config.bi'
' bootsect.bas Copyright (C) 2005, 2006, 2007, 2008 Sebastian McClouth
'
' Print some insane message
RegsX.AX = &H300
INTERRUPTX &H10, RegsX, RegsX ' read cursor pos
RegsX.CX = 24
RegsX.BX = VAL("&H" + "00" + "07")'page 0, attribute 7 (normal)
FOR count = 1 TO LEN(msg1)
RegsX.AX = VAL("&H" + "e" + HEX$(ASC(MID$(msg1, count, 1)))) 'write string move cursor
INTERRUPTX &H10, RegsX, RegsX
NEXT count
'ok, we've written the message, now we get the current cursor position
'and save it for posterity.
RegsX.AX = &H300 'read cursor pos
INTERRUPTX &H10, RegsX, RegsX
GOSUB empty8042
'GOTO HEAD
SYSTEM 'needs to end here anyway
' This routines checks that the keyboard queue is empty
' No timeout is used - if this hangs there is something wrong with
' the machine, and we probably couldn't proceede anyway.
empty8042:
RegsX.AX = &HB00
INTERRUPTX &H21, RegsX, RegsX
IF (RegsX.AX AND &HFF) <> 0 THEN
DEF SEG = &H40: POKE &H1C, PEEK(&H1A): DEF SEG
END IF
RETURN
Code: Select all
'$INCLUDE:'include/qbinux/autoconf.bi'
DECLARE SUB INTERRUPTX (IntNum%, InRegs AS RegTypeX, OutRegs AS RegTypeX)
DIM SHARED msg1 AS STRING
DIM SHARED RegsX AS RegTypeX
DIM SHARED UTS AS UTSName
msg1 = "Loading..."
UTS.SysName = "QBinux"
UTS.NodeName = "(none)" 'set by sethostname()
UTS.Machine = "i386" 'hardware type
UTS.DomainName = "(none)" 'set by domainname()
'
' The definitions for UTS.Release AND UTS.Version are defined in
' qbinux/version.bi, and should only be used by qbinux.version.bi
Code: Select all
'$INCLUDE:'include/qbinux/utsname.bi'
TYPE RegTypeX
AX AS INTEGER
BX AS INTEGER
CX AS INTEGER
DX AS INTEGER
BP AS INTEGER
SI AS INTEGER
DI AS INTEGER
flags AS INTEGER
END TYPE
Code: Select all
TYPE UTSName
SysName AS STRING * 64
NodeName AS STRING * 64
Release AS STRING * 64
Version AS STRING * 64
Machine AS STRING * 64
DomainName AS STRING * 64
END TYPE
Grtz