SDOS, SD Card driver for PC-6001 Series Copyright (c) 2008 by Takahide Matsutsuka, All rights reserved. http://www.markn.org/pc-6001/ 1. Usage Type 'sd' and an enter key in the BASIC text mode to enter a command mode with "%" prompt. Available commands in the command mode are as follows: ? Show brief usage of commands. Example: % ? ls List directory information. Example: % ls cd [directory] Change current directory. If the directory is not specified, change current to the root directory. You cannot specify multiple levels like "a/b". Example: % cd sub ad [address] Specify an address in maximum four hexadicimal digits. You don't need "0x" or "&h" prefixes, nor "h" suffix. The address is used for loading start address (in RAW mode) and execution address. If the address is not specified, current value is shown. Example: % ad a800 rs Reset joystick port for SD card adapter. Example: % rs st Show file information. BASIC, MP6, and RAW are supported. Example: % st ax-9.p6 ex [arguments] Execute from specified address. Execution address is automatically specified by loaded file type. Alternatively, you can specify the address by 'ad' command. Optional arguments are passed through the program. This feature is supported in mp6 files. Example: % ex movie.pmv mo [options] Mode selection. The following options are supported. a automatic execution enabled (default) A automatic execution disabled v verbose mode V quiet mode (default) c crt-kill enabled while loading C crt-kill disabled while loading (default) If the options is not specified, current value is shown. Example: % mo vA [arguments] If you specify a file name, the OS loads the file. File type is automatically identified by the header of the file (a file extention is not respected). Supported file types are described below. Example: % intro1.p6 Example: % pmv movie.pmv Note that successfully loaded file of p6 or mp6 is *automatically executed* unless configured by 'mo' command. For mp6 file, optional arguments are passed through the program. All commands are case sensitive and all file names are case insensitive. Therefore, you can use upper letters if you want to specify a file name that has the same name as a command. 2. Supported file types 2-1. BASIC file header: 16 bytes 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, 0xd3, <6-byte BASIC Cassette file name> Loading address is specified automatically according to the current BASIC mode and pages. 2-2. MP6 file header: 16 bytes 0x54, 0x4d, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, 0x67, <1-byte mode>, <1-byte pages>, <2-byte load>, <2-byte exec> type: available mode (shown by 'st' command, but yet supported) pages: available pages (shown by 'st' command, but yet supported) load: loading start address, little endian exec: execution start address, little endian After the file has been loaded, the address is set to the specified execution address. A following 'ex' command starts from the address without explicitly specifying an address. 2-3. Raw file All files other than above. It has no header, so you need to specify loading address and execution address manually by 'ad' command. There are a few application specific file types, which are recognized as raw file in SDOS command line, unless an additional plug-in specifies hook. 3. Supported cards and notes SDOS supports all FAT12 or FAT16 formatted MMC and SD cards. Note that FAT32 is not supported, therefore SDHC is not supported either. This software is tested under PC-6001(32kB) and PC-6001mkII. The driver uses SPI mode for accessing MMC/SD cards using AY-3-8910 parallel ports. The average data transfer rate is 2.3kB/s (CRT on) - 4.4kB/s (CRT off) on PC-6001. 6. APIs and hooks SDOS provides a set of APIs and hooks for user programming. The full description is provided as a part of Hexameter project (https://sourceforge.net/projects/hexameter/). 5. Future plans - Support loading of PC-6001 mkII 64kB flat RAM. - Migrate FAT system into extension card with AVR. 6. Version histories 1.0.0 Apr. 24, 2008 Release version Initial release 1.0.1 Apr. 25, 2008 Internal change Move stack area to upper area of VRAM while loading 1.1.0 Apr. 30, 2008 Internal change Command "sdload" introduced 1.2.0 May 1, 2008 Internal change 1.3.0 May 2, 2008 Internal change Command name has been changed to "sd" Commands "ls", "cd', "ad", and "um" have been supported. 1.4.0 May 7, 2008 Release version Some bugs regarding BASIC file have been fixed. MP6 format has been supported. 'ls', 'cd', 'ad', 'rs', 'st', and 'ex' have been supported. Usage document is provided. 1.5.0 May 19, 2008 Release version (SDOS 1.0) A glitch in the stack usage has been fixed. Modes and pages in mp6 format is supported by 'st' command, but yet supported in loading. 1.6.0 Aug. 10, 2008 Release version (SDOS 1.1) 6. Acknowledgement This software has been initially derived from Tiny-FatFs by ChaN. 7. Copyright notice Copyright (c) 2008, Takahide Matsutsuka. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the author nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.