Page 1 of 1

Error during run-time initialization

Posted: Tue Jan 22, 2008 4:15 pm
by Seb McClouth
The compile-problem has been solved, but now I'm stuck with Error during run-time initialization when I try to run the file.

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
boot\bootsect.bas

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
include/qbinux/autoconf.bi: (not sure but I think I've forgotten sumfin here)

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
include/qbinux/utsname.bi:

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
Yes are true QBinux-codings and as you can see based upon Linux, sometimes even the same code (translated to QB ofcourse).

Grtz

Posted: Wed Jan 23, 2008 12:29 am
by Plasma
Works fine for me. Probably the problem is in your batch file. You never delete testrun.exe, and ren will fail if the destination is present. So you are most likely not running the built exe, but an older one.

(The error message you got occurs when you use a runtime library with different string or math settings that your object files.)

btw You need an InterruptX in that for loop, or your message will never display...

Also I'm not quite sure where you're going with this, but if this is supposed to be a "real" OS and not just something that runs in DOS, you can't use QB's runtime library and you can't use int 21.

Posted: Wed Jan 23, 2008 2:49 pm
by Seb McClouth
I edited the code because I have indeed forgot to copy stuff from the source on my laptop.

Grtz

Posted: Wed Jan 23, 2008 2:54 pm
by Seb McClouth
Plasma wrote:Also I'm not quite sure where you're going with this, but if this is supposed to be a "real" OS and not just something that runs in DOS, you can't use QB's runtime library and you can't use int 21.
For the time being it is a Shell (or as I call it a platform-OS). Like you have Bash for Linux QBinux is actually relying on the core, which runs ofcourse on Dos (the most stable OS ever from Microsoft, atleast thats what I think.).

If I plan on making a real os... it'll be with the orginal Linux but I might call the distribution McClouth Linux or something.

Could you explain how to get the libraries? I've reinstalled the whole PDS, but I never had that problem before. Only this time.

Grtz

Oh, no!

Posted: Wed Jan 23, 2008 5:10 pm
by burger2227
Not another version of Linux!

Aren't there enough already? :roll:

Re: Oh, no!

Posted: Wed Jan 23, 2008 5:23 pm
by Seb McClouth
burger2227 wrote:Not another version of Linux!

Aren't there enough already? :roll:
MIGHT!! No saying I will... QBinux is cool enough for now...

Posted: Thu Jan 24, 2008 6:22 am
by Seb McClouth
Plasma

At first I had one big module, to make things easy. But as I had always done before, I now again working on seperate modules. But since everything seems to go wrong only bootsect.bas I see at this point no use in creating the other modules.

I'm now stuck with the error L2029: 'INTERRUPTX' : unresolved external.

And ofcourse the 'error during run-time initialization'.

You happen to know how to fix this?

Not sure but

Posted: Thu Jan 24, 2008 11:10 am
by burger2227
If your InterruptX is the same as QB's you need DS and ES. Otherwise why not just use Interrupt with your above REGTYPE? I am not familiar with QBinux however.

Just a thought,

Ted

Posted: Thu Jan 24, 2008 5:45 pm
by Seb McClouth
I've tried something that I've seen once before. I've loaded every module into PDS, and it created .MAK-file. Running from inside PDS then and compiling gives me no more errors.