Mail Archives: djgpp/2002/05/08/04:45:25
X-Authentication-Warning: | delorie.com: mailnull set sender to djgpp-bounces using -f
|
From: | "Peter Cassidy" <peter DOT cassidy AT rocksoft DOT com>
|
Newsgroups: | comp.os.msdos.djgpp
|
References: | <3cd86fd5 AT duster DOT adelaide DOT on DOT net>
|
Subject: | Re: Hacking long file names from pure DOS
|
Date: | Wed, 8 May 2002 18:12:44 +0930
|
Lines: | 269
|
Organization: | Rocksoft Limited
|
X-Newsreader: | Microsoft Outlook Express 5.50.4522.1200
|
X-MimeOLE: | Produced By Microsoft MimeOLE V5.50.4522.1200
|
NNTP-Posting-Host: | cu1583.adelaide.adsl.on.net
|
Message-ID: | <3cd8e54a$1@duster.adelaide.on.net>
|
X-Trace: | duster.adelaide.on.net 1020847434 cu1583.adelaide.adsl.on.net (8 May 2002 18:13:54 +0950)
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
> I have a requirement to see and set long file names from pure DOS booted
> from a 'recovery disk' floppy.
>
> I have to demonstrate something to a customer by the weekend, so we're
quite
> happy to pay $money to get fast help on this.
>
I have more information: it _only_ crashes in the presence of a file with a
long file name. In that case, when looking at the C: (hard disk) and A:
(floppy) it will _always_ crash, but when looking at R: (ram disk), its
behaviour is more complex. On the ram disk it will run if it ran
successfully the _previous_ time. E.g.:
R: mickey.exe ==> crash!
remove long file name file
R: mickey.exe ==> works.
R: mickey.exe ==> works.
put long file name back
R: mickey.exe ==> works.
C: mickey.exe ==> crash!
R: mickey.exe ==> crash!
Weird, huh?
lfndos 1.06 reports the disks as R: 'FAT ', C:'FAT32 ' and doesn't
mention A:
The residency or otherwise of CWSDPMI seems to have absolutely no effect.
I hope someone can help.
I have more detail (as reqd by FAQ 6.17) to aid the detective work:
SET:
CONFIG=AUTO
PROMPT=$p$g
SRCDRV=a:
RAMDRV=r:
TEMP=r:\tmp
TMP=r:\tmp
COMSPEC=r:\bin\command.com
PATH=R:\NET;R:\BIN;R:\
CMDLINE=edit autoexec.bat
CONFIG.SYS:
[menu]
menuitem=AUTO, Boot with emm386 (most compatible)
menuitem=MAX, Boot with emm386 (max memory)
menuitem=NOEMM, Boot without emm386
menuitem=CLEAN, Clean boot
menudefault=AUTO,5
[AUTO]
switches=/f
break=off
dos=high,umb
files=20
buffers=20
lastdrive=z
device=a:\bin\himem.sys /testmem:off /v
device=a:\bin\emm386.exe /v x=d000-d8ff h=128 noems notr
shell=a:\command.com /e:1024 /p
device=a:\bin\ifshlp.sys
[MAX]
switches=/f
break=off
dos=high,umb
files=20
buffers=20
lastdrive=z
device=a:\bin\himem.sys /testmem:off /v
device=a:\bin\emm386.exe /v h=128 noems
shell=a:\command.com /e:1024 /p
device=a:\bin\ifshlp.sys
[NOEMM]
switches=/f
break=off
dos=high,umb
files=20
buffers=20
lastdrive=z
device=a:\bin\himem.sys /testmem:off /v
shell=a:\command.com /e:1024 /p
device=a:\bin\ifshlp.sys
[CLEAN]
shell=a:\command.com /p
GO32-V2:
go32/v2 version 2.0 built Dec 24 2001 21:25:02
Usage: go32 coff-image [args]
Rename this to go32.exe only if you need a go32 that can run v2 binaries as
well as v1 binaries (old makefiles). Put ahead of the old go32 in your
PATH
but do not delete your old go32 - leave it in the PATH after this one.
Set GO32_V2_DEBUG=y in the environment to get verbose output.
DPMI memory available: 5329 Kb
DPMI swap space available: 129919 Kb
SYMIFY:
V:\DJGPP\BIN>c:
C:\>mickey.exe
Hello all parallel universes.
Exiting due to signal SIGSEGV
Page fault at eip=0000357a, error=0004
eax=0000001e ebx=00000004 ecx=00000035 edx=00000000 esi=00000000
edi=00014f60
ebp=00094f08 esp=00094ee8 program=C:\MICKEY.EXE
cs: sel=00a7 base=10000000 limit=0009ffff
ds: sel=00af base=10000000 limit=0009ffff
es: sel=00af base=10000000 limit=0009ffff
fs: sel=008f base=0004a740 limit=0000ffff
gs: sel=00bf base=00000000 limit=0010ffff
ss: sel=00af base=10000000 limit=0009ffff
App stack: [00094f60..00014f60] Exceptn stack: [00014eb4..00012f74]
Call frame traceback EIPs:
0x0000357a _readdir+18
0x0000165b _main+59, line 12 of mickey.c
0x00002f78 ___crt1_startup+176
C:\>symify -o dump.out mickey.exe
AUTOEXEC.BAT:
@echo off
rem ---------------------------------------
rem AUTOEXEC.BAT
rem (c) 2002 Bart Lagerweij
rem ---------------------------------------
rem
set prompt=$p$g
echo MODBOOT v2.1, (c) 2001-2002, Bart Lagerweij
echo http://www.nu2.nu/bootdisk/modboot/
echo.
rem The source drive
set srcdrv=a:
rem The ramdisk drive
set ramdrv=r:
rem if exist %srcdrv%\diskid.txt type diskid.txt
rem
path=%srcdrv%\bin;%srcdrv%\
if "%config%" == "CLEAN" goto _end
if not exist %srcdrv%\bin\smartdrv.exe goto _nosdrv
echo AUTOEXEC: Loading smartdrv.exe
lh %srcdrv%\bin\smartdrv.exe
:_nosdrv
rem
rem check if himem is loaded
if exist XMSXXXX0 goto _xmsok
echo.
echo AUTOEXEC: No XMS manager installed (himem.sys)
goto _abort
:_xmsok
rem Setup the ramdisk
if exist %ramdrv%\bin\extract.exe goto _skipcp
rem load a 8MB ramdisk
echo AUTOEXEC: Setting up Ramdisk
xmsdsk 8192 %ramdrv% /y /t
if errorlevel 1 goto _ramok
rem xmsdsk returns errorlevel 0 for error
goto _abort
:_ramok
rem
md %ramdrv%\bin
md %ramdrv%\tmp
set temp=%ramdrv%\tmp
set tmp=%ramdrv%\tmp
rem
if exist %ramdrv%\bin\extract.exe goto _skipcp
echo AUTOEXEC: Copying some files to ramdisk
rem copy command.com to ramdisk
copy %srcdrv%\command.com %ramdrv%\bin
if not exist %ramdrv%\bin\command.com goto _abort
set comspec=%ramdrv%\bin\command.com
copy %srcdrv%\bin\extract.exe %ramdrv%\bin
if not exist %ramdrv%\bin\extract.exe goto _abort
:_skipcp
set path=%ramdrv%\bin;%ramdrv%\
rem check for smartdrv.cab
if not exist %srcdrv%\bin\smartdrv.cab goto _nosdrv2
echo AUTOEXEC: Loading smartdrv.exe from smartdrv.cab
rem extract /y /l %ramdrv%\ /e %srcdrv%\bin\smartdrv.cab > %tmp%\extract.out
extract /y /l %ramdrv%\ /e %srcdrv%\bin\smartdrv.cab
if errorlevel 1 goto _unpackerr
rem should be here
if exist %ramdrv%\bin\smartdrv.exe lh %ramdrv%\bin\smartdrv.exe
rem maybe some people put it here
if exist %ramdrv%\smartdrv.exe lh %ramdrv%\smartdrv.exe
:_nosdrv2
extract /y /l %ramdrv%\ /e %srcdrv%\bin\modboot.cab > %tmp%\extract.out
if errorlevel 1 goto _unpackerr
if exist %tmp%\extract.out del %tmp%\extract.out
if exist %ramdrv%\bin\modboot.bat goto _modboot
echo.
echo AUTOEXEC: Missing file "%ramdrv%\bin\modboot.bat"
goto _abort
:_unpackerr
if exist %tmp%\extract.out type %tmp%\extract.out
if exist %tmp%\extract.out del %tmp%\extract.out
echo.
echo AUTOEXEC: Error while unpacking "%srcdrv%\bin\modboot.cab"
goto _abort
:_modboot
rem set CWD to ramdisk
%ramdrv%
cd \
%ramdrv%\bin\modboot.bat
rem should not get here
:_abort
echo AUTOEXEC: Aborted...
echo.
pause
rem flow into "_end"
:_end
"Peter Cassidy" <peter DOT cassidy AT rocksoft DOT com> wrote in message
news:3cd86fd5 AT duster DOT adelaide DOT on DOT net...
> The DOS boot disk comes from "Bart's Boot Disks"
> (http://membres.lycos.fr/jfb/gb/TCPIP.htm and http://www.nu2.nu/bootdisk)
> (built from W98, DOS 4.10.2222) and the long file name support from LFNDOS
> 1.06 (http://saturn.spaceports.com/~dosuser/). DPMI is provided by
> CWSDMPI.EXE.
>
> I'm testing with a mickey mouse program:
> #include <stdio.h>
> #include <dirent.h>
>
> main()
> {
> DIR *d = opendir(".");
>
> struct dirent *de;
>
> printf("Hello all parallel universes.\n");
>
> while (de = readdir(d))
> puts(de->d_name);
> closedir(d);
> }
>
> which is compiled under gcc from djgpp 203.
>
> I run CWSDPMI -s-
>
> then test LFNDOS with the DOS DIR command. Before LFNDOS, no long names;
> after LFNDOS, long file names appear. So far so good.
>
> But when I run 'mickey' I get a SEGV after the printf. i.e. it's opening
> the dir but not reading it. Any ideas anyone?
>
> Sorry I haven't got all the config detail in this post but it's late at
> night here in Oz, and I'm going to bed, and meanwhile y'all can tell me
> which important information I left out. Also please forgive the newbie
> question; I only started using djgpp/lfndos etc. yesterday!
>
> Peter
>
> --
>
> Peter Cassidy (peter DOT cassidy AT rocksoft DOT com), +61 412 283 366.
> CTO, Rocksoft Limited.
> Ph: +61 8 8232 6262 Fax: +61 8 8232 6264 http://www.rocksoft.com/
> Protect your files with Veracity data integrity: http://www.veracity.com/
- Raw text -