Commit beff2f0f authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Unstamped files (marked by DOS with a time and date of 0x0000) will now return...

Unstamped files (marked by DOS with a time and date of 0x0000) will now return 01-Jan-1900 rather than very late at night on 31-Dec-1979.

Can now set the RISC OS type to 0x000 (previously this would then have been
stamped as 0xFE4 since 0x000 was used as a magic 'no filetype found' marker.
Will now try to use MimeMap if no 'dosmap'ping was found,in this way dosmap
overrides MimeMap for DOSFS - if neither offer a match,0xFE4 is used.
Updated messages to reflect this.
Discs formatted under DOSFS will now set the OEM vendor id to "DOSFS   ".

Version 0.67. Tagged as 'DOSFS-0_67'
parent 9033d5b1
DOSMap:*DOSMap specifies an MSDOS extension to RISC OS filetype mapping. The RISC OS\rfiletype can be given as either a 12bit HEX ASCII number or as the text\ridentifier defined by a suitable File$Type_XXX variable. If no RISC OS\rfiletype is given, then the existing MSDOS extension (if present) will be\rremoved. If no parameters are given then the current mappings are displayed.\rSyntax:\t*DOSMap [<MSDOS extension> [<RISC OS filetype>]]
DOSMap:*DOSMap specifies an MSDOS extension to RISC OS filetype mapping which overrides the one held in the central Mime Map.\r\tThe RISC OS filetype can be given as either a 12bit HEX ASCII number or its text identifier.\r\tWhen no RISC OS filetype is given, the existing MSDOS extension (if present) will be removed.\r\tIf no parameters are given, then the current mappings are displayed.\rSyntax:\t*DOSMap [<MSDOS extension> [<RISC OS filetype>]]
CopyBoot:*CopyBoot allows the MS-DOS BOOT BLOCK from one floppy to be copied over the\rBOOT BLOCK of another.\rSyntax:\t*CopyBoot <src-drive> <dest-drive>
No preview for this file type
/* (0.66)
/* (0.67)
*
* This file is automatically maintained by srccommit, do not edit manually.
* Last processed by srccommit version: 1.62.
*
*/
#define Module_MajorVersion_CMHG 0.66
#define Module_MajorVersion_CMHG 0.67
#define Module_MinorVersion_CMHG
#define Module_Date_CMHG 16 Aug 2001
#define Module_Date_CMHG 15 Mar 2002
#define Module_MajorVersion "0.66"
#define Module_Version 66
#define Module_MajorVersion "0.67"
#define Module_Version 67
#define Module_MinorVersion ""
#define Module_Date "16 Aug 2001"
#define Module_Date "15 Mar 2002"
#define Module_ApplicationDate2 "16-Aug-01"
#define Module_ApplicationDate4 "16-Aug-2001"
#define Module_ApplicationDate2 "15-Mar-02"
#define Module_ApplicationDate4 "15-Mar-2002"
#define Module_ComponentName "DOSFS"
#define Module_ComponentPath "RiscOS/Sources/FileSys/ImageFS/DOSFS"
#define Module_FullVersion "0.66"
#define Module_HelpVersion "0.66 (16 Aug 2001)"
#define Module_FullVersion "0.67"
#define Module_HelpVersion "0.67 (15 Mar 2002)"
#define Module_LibraryVersionInfo "0:67"
/* Copyright 1996 Acorn Computers Ltd
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/************************************************/
/************************************************/
/** THIS FILE IS NO LONGER USED, SEE s.Statics **/
/************************************************/
/************************************************/
/*> c.BOOTblock <*/
/*-------------------------------------------------------------------------*/
/* This file contains the default BOOT BLOCK as layed down by the DOSFS
* module after a format. This BOOT BLOCK copy contains disc description
* information for a 720K double-sided MS-DOS disc. This can be over-written
* with the information necessary for the actual disc format.
*/
/*-------------------------------------------------------------------------*/
#include "DOSshape.h"
/*-------------------------------------------------------------------------*/
/* This is a nasty large constant array. It contains the hex code for
* the standard 8086 boot code.
*/
DOS_bootsector default_dbsector = {
/* BOOT_JMP */ {0xEB,0x34,0x90},
/* BOOT_OEM */ {0x4D,0x53,0x44,0x4F,0x53,0x33,0x2E,0x33},
/* BOOT_secsize */ 0x00,
/* BOOT_secsizeHI */ 0x02,
/* BOOT_secalloc */ 0x02,
/* BOOT_reserved */ 0x01,
/* BOOT_reservedHI */ 0x00,
/* BOOT_num_fats */ 0x02,
/* BOOT_root_dir */ 0x70,
/* BOOT_root_dirHI */ 0x00,
/* BOOT_max_sect */ 0xA0,
/* BOOT_max_sectHI */ 0x05,
/* BOOT_magic */ 0xF9,
/* BOOT_FAT_size */ 0x03,
/* BOOT_FAT_sizeHI */ 0x00,
/* BOOT_secstrack */ 0x09,
/* BOOT_secstrackHI */ 0x00,
/* BOOT_heads */ 0x02,
/* BOOT_headsHI */ 0x00,
/* BOOT_hidden */ 0x00,
/* BOOT_hiddenHI */ 0x00,
/* BOOT_code */ {0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x12,0x00,0x00,0x00,0x00,0x01,0x00,
0xFA,0x33,0xC0,0x8E,0xD0,0xBC,0x00,0x7C,
0x16,0x07,0xBB,0x78,0x00,0x36,0xC5,0x37,
0x1E,0x56,0x16,0x53,0xBF,0x2B,0x7C,0xB9,
0x0B,0x00,0xFC,0xAC,0x26,0x80,0x3D,0x00,
0x74,0x03,0x26,0x8A,0x05,0xAA,0x8A,0xC4,
0xE2,0xF1,0x06,0x1F,0x89,0x47,0x02,0xC7,
0x07,0x2B,0x7C,0xFB,0xCD,0x13,0x72,0x67,
0xA0,0x10,0x7C,0x98,0xF7,0x26,0x16,0x7C,
0x03,0x06,0x1C,0x7C,0x03,0x06,0x0E,0x7C,
0xA3,0x3F,0x7C,0xA3,0x37,0x7C,0xB8,0x20,
0x00,0xF7,0x26,0x11,0x7C,0x8B,0x1E,0x0B,
0x7C,0x03,0xC3,0x48,0xF7,0xF3,0x01,0x06,
0x37,0x7C,0xBB,0x00,0x05,0xA1,0x3F,0x7C,
0xE8,0x9F,0x00,0xB8,0x01,0x02,0xE8,0xB3,
0x00,0x72,0x19,0x8B,0xFB,0xB9,0x0B,0x00,
0xBE,0xD6,0x7D,0xF3,0xA6,0x75,0x0D,0x8D,
0x7F,0x20,0xBE,0xE1,0x7D,0xB9,0x0B,0x00,
0xF3,0xA6,0x74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0x70,0x6C,0x61,0x63,
0x65,0x20,0x61,0x6E,0x64,0x20,0x73,0x74,
0x72,0x69,0x6B,0x65,0x20,0x61,0x6E,0x79,
0x20,0x6B,0x65,0x79,0x20,0x77,0x68,0x65,
0x6E,0x20,0x72,0x65,0x61,0x64,0x79,0x0D,
0x0A,0x00,0x0D,0x0A,0x44,0x69,0x73,0x6B,
0x20,0x42,0x6F,0x6F,0x74,0x20,0x66,0x61,
0x69,0x6C,0x75,0x72,0x65,0x0D,0x0A,0x00,
0x49,0x4F,0x20,0x20,0x20,0x20,0x20,0x20,
0x53,0x59,0x53,0x4D,0x53,0x44,0x4F,0x53,
0x20,0x20,0x20,0x53,0x59,0x53,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00},
/* BOOT_signature */ 0x55,
/* BOOT_signatureHI */ 0xAA
} ;
/*-------------------------------------------------------------------------*/
/*> EOF c.BOOTblock <*/
......@@ -53,7 +53,7 @@
/*-------------------------------------------------------------------------*/
#define imagetype (0xFC8) /* as allocated by Acorn : "MSDOSDSC" */
#define imagetype (0xFC8) /* as allocated by Acorn : "DOSDisc" */
/*-------------------------------------------------------------------------*/
/* global (static) variables used within the module */
......
......@@ -49,6 +49,12 @@
#include "h.ADFSshape"
#include "h.Statics"
#define MimeMap_Translate 0x50B00
#define MMM_TYPE_RISCOS 0
#define MMM_TYPE_RISCOS_STRING 1
#define MMM_TYPE_MIME 2
#define MMM_TYPE_DOT_EXTN 3
#define ReadOnlyMapsLocked 1
/* JRS 9/3/92 map DOS ReadOnly bit to RISC OS Locked bit only.
* This is to fix problem with FilerAction setting access 0 to force-delete.
......@@ -302,26 +308,54 @@ static int DOS_image_RW(int op,word sec,int off,byte *ma,word nbytes,DOSdisc *ih
return(0) ;
}
/*---------------------------------------------------------------------------*/
static void read_loadexec(DOS_direntry *dentry,word dosext,time5byte *le)
static void map_FILE_ROStype(DOS_direntry *dentry,word dosext,time5byte *le)
{
int value ;
_kernel_swi_regs rset ;
int value = TRUE;
MSDOStoRISCOS(get_FILE_time(dentry),get_FILE_date(dentry),le) ;
value = get_FILE_ROStype(dentry) ;
if (value != 0)
le->hi = (le->hi & ~ADFStypemask) | (value << 8) ;
else
/* Try to determine whether this really is a ROS filetype or a win95 'creation time' */
if ((dentry->FILE_reserved[1] & 0xF0) == 0)
{
tracef1("filetype lookup,found in spare bytes 0x%X3\n", value);
value = get_FILE_ROStype(dentry);
}
/* No filetype in the spare bytes,so have a look through DOSmap */
if (value == TRUE)
{
mapentry *cmap ;
for (cmap = maplist; (cmap); cmap = cmap->next)
mapentry *cmap ;
for (cmap = maplist; (cmap); cmap = cmap->next)
if (cmap->dosext == dosext)
{
le->hi = (le->hi & ~ADFStypemask) | (cmap->ROtype << 8) ;
break ;
value = cmap->ROtype;
tracef1("filetype lookup,found in dosmap 0x%X3\n", value);
break; /* the for loop */
}
}
/* Found neither a filetype nor an override mapping,try MimeMap */
if (value == TRUE)
{
rset.r[0] = MMM_TYPE_DOT_EXTN;
rset.r[1] = (int)&dosext;
rset.r[2] = MMM_TYPE_RISCOS;
if (_kernel_swi(MimeMap_Translate, &rset, &rset) == NULL)
{
value = rset.r[3];
tracef1("filetype lookup,found in mimemap 0x%X3\n", value);
}
}
/* Give up,just set it as 'DOStype' */
if (value == TRUE) value = DOStype;
le->hi = (le->hi & ~ADFStypemask) | (value << ADFStypeshift) ;
return;
}
/*---------------------------------------------------------------------------*/
static void read_loadexec(DOS_direntry *dentry,word dosext,time5byte *le)
{
MSDOStoRISCOS(get_FILE_time(dentry),get_FILE_date(dentry),le) ;
map_FILE_ROStype(dentry,dosext,le);
return ;
}
......@@ -1690,20 +1724,8 @@ static FS_dir_block *read_dir(int rtype,char *fname,word dest,word num,word off,
/* check if the file has RISC OS information in its spare bytes */
if (rtype)
{
int value = get_FILE_ROStype(dentry) ;
if (value != 0) /* non-NULL then this is the RISC OS filetype */
le.hi = (le.hi & ~ADFStypemask) | (value << 8) ;
else
{
mapentry *cmap ;
/* NO so use the calculated DOS extension */
for (cmap = maplist; (cmap); cmap = cmap->next)
if (cmap->dosext == dosext)
{
le.hi = (le.hi & ~ADFStypemask) | (cmap->ROtype << 8) ;
break ; /* the for loop */
}
}
/* Try to find the filetype */
map_FILE_ROStype(dentry,dosext,&le);
/* RISC OS required information */
entries->loadaddr = le.hi ;
......@@ -2365,22 +2387,8 @@ FS_open_block *DOSFS_open_file(word op,char *fname,DOSdisc *ihand)
tracef1("DOSFS_open_file: FILE_list (after) = &%08X\n",(int)FILE_list) ;
/* convert the MSDOS timestamp to a RISC OS 5byte value */
MSDOStoRISCOS(get_FILE_time(dentry),get_FILE_date(dentry),&le) ;
{
int value = get_FILE_ROStype(dentry) ;
if (value != 0)
le.hi = (le.hi & ~ADFStypemask) | (value << 8) ;
else
{
mapentry *cmap ;
for (cmap = maplist; (cmap); cmap = cmap->next)
if (cmap->dosext == dosext)
{
le.hi = (le.hi & ~ADFStypemask) | (cmap->ROtype << 8) ;
break ;
}
}
}
read_loadexec(dentry,dosext,&le);
fdesc->loadaddr = le.hi ; /* load address */
fdesc->execaddr = le.lo ; /* exec address */
......@@ -3143,21 +3151,7 @@ FS_cat_entry *DOSFS_delete(char *fname,DOSdisc *ihand)
(void)after((char *)&dosext,DOSname,file_sep,1) ;
/* construct return information */
MSDOStoRISCOS(get_FILE_time(dentry),get_FILE_date(dentry),&le) ;
value = get_FILE_ROStype(dentry) ;
if (value != 0)
le.hi = (le.hi & ~ADFStypemask) | (value << 8) ;
else
{
mapentry *cmap ;
for (cmap = maplist; (cmap); cmap = cmap->next)
if (cmap->dosext == dosext)
{
le.hi = (le.hi & ~ADFStypemask) | (cmap->ROtype << 8) ;
break ;
}
}
read_loadexec(dentry,dosext,&le);
{
byte status = dentry->FILE_status;
......
This diff is collapsed.
......@@ -274,7 +274,7 @@ void MSDOStoRISCOS(word MStime,word MSdate,time5byte *outtime)
{
/* this generates RISC OS style LOAD and EXEC addresses containing the
* given MSDOS time/date
* The RISC OS file type is set to "DOStype"
* The RISC OS file type is set to "DOS"
*
* load address: = &FFFtttdd
* exec address: = &dddddddd
......@@ -292,16 +292,16 @@ void MSDOStoRISCOS(word MStime,word MSdate,time5byte *outtime)
otime.seconds = (((MStime & sec_mask) >> sec_shift) * 2) ;
otime.centiseconds = 0 ;
if (BCDto5byte(&otime,outtime) < 0)
if ((BCDto5byte(&otime,outtime) < 0) || (MStime==MSdate==0))
{
outtime->hi = ((ADFStimestamp | 0x00) & ~ADFStypemask) ;
outtime->lo = 0x00000000 ;
outtime->hi = ((ADFStimestamp | 0x00) & ~ADFStypemask) ;
outtime->lo = 0x00000000 ;
}
else
outtime->hi = ((ADFStimestamp | (outtime->hi & 0xFF)) & ~ADFStypemask) ;
/* and add in the DOS file-type identifier */
outtime->hi |= (DOStype << 8) ;
outtime->hi |= (DOStype << ADFStypeshift) ;
return ;
}
......
......@@ -198,7 +198,7 @@ func_DOS_formats
EXPORT func_default_dbsector
func_default_dbsector
DCB &EB,&34,&90 ; BOOT_jmp
DCB &4D,&53,&44,&4F,&53,&33,&2E,&33 ; BOOT_OEM
DCB "DOSFS " ; BOOT_OEM
DCB &00 ; BOOT_secsize
DCB &02 ; BOOT_secsizeHI
DCB &02 ; BOOT_secalloc
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment