Hi Eric, Thanks for replying, see comments below,
----- Original Message ----- From: "Eric Auer" <[EMAIL PROTECTED]> To: "Hans" <[EMAIL PROTECTED]>; <freedos-kernel@lists.sourceforge.net> Sent: Saturday, October 25, 2008 5:46 PM Subject: Re: [Freedos-user] init_device crash/hang > > Hi Hans, replying via freedos-kernel... > >> My system seems to boot until it starts init_device() in kernel/main.c. >> InitIO calls init_device 12 times before my system crashes (see below)... > >> KERNEL: Entering init_kernel()... >> HMA moving 0268:0000 up to 9fde:0000 for 9cdf bytes > > This message is a bit misleading - the kernel is moved to > the end of DOS RAM instead of to the HMA (I assume you do > not have HIMEM loaded yet ;-))... What worries me here is > that moving 40 kB to a location only 0.5 kB before the end > of the first 640 kB of RAM means that a part of the kernel > will end up AFTER that - it could fall into a hole without > any RAM, or it could end up in the VGA RAM if it exists?? My system has 1Mbyte of RAM with the top 8Kbyte taken by the BIOS. All ram is available, the BIOS test the first 704Kbyte of memory and returns that by int12 and stores it in 0040:0013. I used 704 as that was one of the values used in the anonymous bios source code which is floating on the web. Changing it to 640 resulted in: HMA moving 026e:0000 up to 8fbd:0000 for 9e3f bytes > > Maybe your int 0x12 handler reports too much DOS RAM? > Or maybe your _CS or FP_SEG have problems? Do you use > the recommended OpenWatcom or Turbo C 2 compilers or > something else? 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 After that it compiled OK. I will install Watcom 1.2 as this is the recommended version. > I must say the calculation of the arg > for MoveKernel (lpTop) looks a bit like black magic... > >> KERNEL: Calling InitIO()... >> *InitIO* *InitIO* *InitIO* *InitIO* *InitIO* *InitIO* >> *InitIO* *InitIO* *InitIO* *InitIO* *InitIO* *InitIO* > > At which place did you insert that InitIO printing? > If in init_device, then maybe you can make it show > which device it handles. Normal sequence would be: > > nul, con, prn, aux, lpt1, > lpt2, lpt3, com1, com2, com3, > com4, clock$, blockdevices > >> Invalid Opcode at 0F68 00D0 3286 00D0 D400 8227 1332 7003 >> E000 7C27 7CAD FEAD 72FF ... whatever ;-) I think this is my mistake, please ignore :-) > > It is also possible that initio worked and you crashed in > InitPrinters instead, which calls int 0x11 and 0x17.0100? > > Eric > > PS: SOURCE_DATE_STRING being set to Sep 09 2005 indicates > you do not use the most recent sources - please update to > SVN or http://rugxulo.googlepages.com/ke2008mar8-src.zip Interestingly this version gets a lot further, FreeDOS kernel build 2038 [version Mar 9 2008 compiled Oct 26 2008] Kernel compatibility 6.22 - WATCOMC (C) Copyright 1995-2006 Pasquale J. Villani and The FreeDOS Project. All Rights Reserved. This is free software and comes with ABSOLUTELY NO WARRANTY; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. 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...... KERNEL: Calling set_DTA...... Now it seems to get struck in the int 21h/1a handler, isn't debugging with printf statements fun ....;-) Regards, Hans. ------------------------------------------------------------------------- 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