Error during run-time initialization

If you have questions about any aspect of QBasic programming, or would like to help fellow programmers solve their problems, check out this board!

Moderators: Pete, Mods

Post Reply
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Error during run-time initialization

Post 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
Last edited by Seb McClouth on Wed Jan 23, 2008 2:50 pm, edited 1 time in total.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
Plasma
Coder
Posts: 11
Joined: Tue Apr 04, 2006 7:28 pm

Post 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.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post by Seb McClouth »

I edited the code because I have indeed forgot to copy stuff from the source on my laptop.

Grtz
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post 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
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Oh, no!

Post by burger2227 »

Not another version of Linux!

Aren't there enough already? :roll:
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Re: Oh, no!

Post 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...
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post 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?
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
User avatar
burger2227
Veteran
Posts: 2466
Joined: Mon Aug 21, 2006 12:40 am
Location: Pittsburgh, PA

Not sure but

Post 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
Please acknowledge and thank members who answer your questions!
QB64 is a FREE QBasic compiler for WIN, MAC(OSX) and LINUX : https://www.qb64.org/forum/index.php
Get my Q-Basics demonstrator: https://www.dropbox.com/s/fdmgp91d6h8ps ... s.zip?dl=0
User avatar
Seb McClouth
Veteran
Posts: 342
Joined: Wed Nov 09, 2005 7:47 am
Location: Inside the Matrix...
Contact:

Post 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.
QBinux is a Linux distribution with the aim of integrating the work of the vast community of free software developers at Pete's QBASIC Site in order to create a modern, performant, safe and easy to use system for system administrators and desktop users.
Post Reply