Hello FreeDOS developers.
We are using FreeDOS 1.0 in our embedded systems. FreeDOS is a good
replacement of ROM-DOS we previouslly used. Thank you for all the great work
on FreeDOS.
I found two small problems related to Floppy disk(FD) and fixed it by
modifying FreeDOS kernel sources(2036 cvs). I send patches to fix these
problems. My patches are applicable to kernel 2036 cvs.
If you consider the patches and incorporate to your kernel tree, it should be
great for me.
The patches are uploaded here.
http://us.f13.yahoofs.com/bc/48b6f314_185bc/bc/freedos/patch080818.zip?bfh__vIBxIiwN9fQ
Two problems are:
Problem 1: Maxell new FD has No 55-aa magic number in boot sector.
Problem 2: Floppy disk change recognition problem.
-------------------------------------------------------------------------------
Problem 1: Maxell new FD has No 55-aa magic number in boot sector.
When we used Maxell FD, we encountered strange phenomena. We wrote files to FD.
Write process was looking good. But there is no file in checking the FD on
Windows.
After precise investigation, I found a lack of 55-aa magic number in the last
two bytes of the boot sector of Maxell FD. FreeDOS getbpb() function is
checking 55-aa magic number. If no 55-aa magic number, FreeDOS assumes the FD
as a 720KB(not 1440KB) FD.
---- Maxell FD boot sector dump (No 55-aa at 01feh) ----
00000000 eb 34 90 4d 41 58 45 4c 4c 20 20 00 02 01 01 00 |.4.MAXELL .....|
00000010 02 e0 00 40 0b f0 09 00 12 00 02 00 00 00 00 00 |[EMAIL PROTECTED]|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
---- TDK FD boot sector dump (There's 55-aa at 01feh) ----
00000000 eb 34 90 49 42 4d 20 20 33 2e 33 00 02 01 01 00 |.4.IBM 3.3.....|
00000010 02 e0 00 40 0b f0 09 00 12 00 02 00 00 00 00 00 |[EMAIL PROTECTED]|
00000020 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 12 |................|
00000030 00 00 00 00 01 00 fa 33 c0 8e d0 bc 00 7c 16 07 |.......3.....|..|
:
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
--------------------------------------------------
ROM-DOS, PC-DOS and Windows has no problem with the Maxell FD. So I think
FreeDOS is too strict in checking boot sector format. Original FreeDOS
checks 55-aa magic number and sector size (=512). My patch disables checking
of 55-aa magic number and only checks sector size.
fdos-maxell-fd-patch-080818.diff modifies kernel/dsk.c.
-------------------------------------------------------------------------------
Problem 2: Floppy disk change recognition problem.
When we write two FD on our application, the first FD's directory entries was
copied onto the second FD. This problem was not occurred on ROM-DOS and PC-DOS.
After precise investigation, I found that our application is calling BIOS
int-13h AH=02h(Sector read) before the second FD write.
Test program DISKCHG.C demonstrates this problem through steps as follows.
1. insert disk-1
2. write A:FILE1 calling DOS
3. change FD to disk-2
4. read FD boot sector calling BIOS int-13h AH=02h
5. write A:FILE2 calling DOS
Disk-2 directory entry contains two files FILE1 and FILE2.
Normally disk change is notified on calling BIOS int-13h AH=00h-05h,08h,
15h-18h. But disk change notification from BIOS is the ONLY ONCE. So on the
subsequent call of BIOS int-13h AH=16h(Detect disk change) from FreeDOS
kernel, no disk change will be notified and FD cache in kernel will NOT be
flushed. Then the first FD's directory data will be written into the second FD.
My patch introduced int-13h hooking. Disk change status on calling int-13h
AH=00h-05h,08h,15h-18h is memorized and reported on the call of
fl_diskchanged().
Perfect disk change recognition will be accomplished by the patch. Though I
have not examined other DOSs(PC-DOS, ROM-DOS), the same hooking may be used.
fdos-fd-change-patch-080818.diff modifies kernel/main.c and drivers/floppy.asm.
-------------------------------------------------------------------------------
Please consider my patches.
Thanks for your reading. :-)
Toshio Koike
_________________________________________________________________
秋本番!連休たくさんのこの秋、みんなのオススメ週末旅行をチェックしよう
http://clk.atdmt.com/GBL/go/112813570/direct/01/
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-kernel