Hi Eric,

----- Original Message ----- 
From: "Eric Auer" <[EMAIL PROTECTED]>
To: "Hans" <[EMAIL PROTECTED]>; <freedos-kernel@lists.sourceforge.net>
Sent: Sunday, October 26, 2008 7:19 PM
Subject: Re: [Freedos-kernel] [Freedos-user] init_device crash/hang

> Quite exotic. How about using a maintained open
> source BIOS? I mean okay the Bochs / Qemu / ...
> LGPL-ed BIOS is way more than 8 kB, but you can
> probably cut and paste parts to pimp your BIOS.
> As long as you follow the LGPL, of course... No
> real problem, I assume your BIOS works okay :-).

mmmm, not yet (see next posting).

>> I use OpenWatcom 1.7a.
>>
>> I had to change DOS.H slightly to force the else prototype
>>
>> //#if defined(__NT__) || ( defined(__OS2__) &&
>> (defined(__386__)||defined(__PPC__)) )
>> //_WCRTLINK extern unsigned _dos_allocmem( unsigned __size, void
>> **__storage );
>> //#else
>> _WCRTLINK extern unsigned _dos_allocmem( unsigned __size,
>> unsigned short *__seg );
>> //#endif
>
> Can you explain this in more detail? Maybe OW 1.7 somehow
> failed to realize that your target is compiling for DOS...

Not sure, installed 1.7a and executed the build.bat file. This only happens 
on the ke2008mar8-scr kernel. I also noticed that it won't build correctly 
without UPX. As a quick hack I removed the UPX arguments from exeflat (in 
kernel/makefile) which fixed the issue.

#..\utils\exeflat kernel.exe kernel.sys 0x60 -S0x10 -S0x8B $(UPXOPT)
..\utils\exeflat kernel.exe kernel.sys 0x60 -S0x10 -S0x8B

>> I think this is my mistake, please ignore :-)
>
> What was it?

Stack corruption :-(

>
>> KERNEL: Calling InitIO......
>>  NUL CON PRN AUX LPT LPT LPT COM COM COM COM CLO NUL
>> KERNEL: Calling InitPrinters......
>> KERNEL: Calling InitSerialPorts......
>> KERNEL: Calling DOS_PSP......
>
> You mean PSPSet...

Yes, cut and paste the wrong string to printf.

>
>> KERNEL: Calling set_DTA......
>>
>> Now it seems to get struck in the int 21h/1a handler,
>> isn't debugging with printf statements fun ....;-)
>
> So PSPInit is not reached?

The mistake was INT16/01 which didn't set the zero flag. As a result it 
hanged in the check_handle_break() routine in inithndlr.c.

After fixing that I got to the infamous "Bad or missing Command Interpreter" 
issue....

Regards,
Hans.


>
> Note that DOS_PSP is #defined to 0x60... if you modify
> the boot loader or the build batch file to use another
> location then you will have to adjust DOS_PSP as well.
>
> The constant also appears as LOADSEG in the ASM source
> of the boot sectors and as command line argument for
> exeflat in the build batch file as well as in the
> sys sources as load_segment (command line changeable).
>
> Eric
> 



-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Freedos-kernel mailing list
Freedos-kernel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-kernel

Reply via email to