http://beebwiki.mdfs.net/api.php?action=feedcontributions&user=Abz&feedformat=atom
BeebWiki - User contributions [en]
2024-03-29T04:42:10Z
User contributions
MediaWiki 1.30.0-rc.0
http://beebwiki.mdfs.net/index.php?title=Cookies&diff=225
Cookies
2012-04-13T23:28:45Z
<p>Abz: Silly typo.</p>
<hr />
<div>The BeebWiki uses cookies to identify you when you log on to edit pages and to remember<br />
your session preferences. Four standard MediaWiki cookies are stored:<br />
* ''beebwiki_UserName''<br />
* ''beebwiki_UserID''<br />
* ''beebwiki__session''<br />
* ''wikidb_bw_UserName''<br />
<br />
You can delete the cookies, or congifure your browser to delete them after each session. This means that you will have to explicitly log on next time you visit the site. If you browse the site as an anonymous user then no cookies will be stored. See [http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=OJ:L:2009:337:0011:0036:En:PDF EU Directive 2009/136/EC].</div>
Abz
http://beebwiki.mdfs.net/index.php?title=OSWORD_%2672&diff=957
OSWORD &72
2012-02-15T23:04:00Z
<p>Abz: Repsonds better if explicitly selects ADFS before making call.</p>
<hr />
<div>[[Category:OSWORD]]<br />
OSWORD &72 (114) - Perform SCSI/MFM disk operation<br />
__TOC__<br />
==Specification==<br />
On entry:<br />
XY?0 = 0, returned result<br />
XY!1 = data address<br />
XY?5 = command<br />
XY?6 = drive number in b5-b7, sector b16-b20 in b0-b4<br />
XY?7 = sector number b8-b15<br />
XY?8 = sector number b0-b7<br />
XY?9 = number of sectors or 0<br />
XY?10 = 0<br />
XY!11 = data length if X%?9=0<br />
This is a standard SCSI command block. The drive number in XY?6 is ORed with<br />
the current drive. If ADFS is not selected when the call is made, ADFS is<br />
selected. Consequently, any code that calls OSWORD &72 must remember the<br />
current filing system and restore it afterwards.<br />
<br />
===Commands===<br />
&00=Test drive ready<br />
&01=Seek track 0<br />
&03=Request status<br />
&08=Read data<br />
&0A=Write data<br />
&0B=Seek track<br />
&1B=Stop/Start drive; stop if XY?9=0, start if XY?9=1<br />
<br />
===Results===<br />
&00=Ok<br />
&02=Drive door open<br />
&03=Media error, eg disk dirty<br />
&05=Bad SCSI command<br />
&04=Not ready<br />
&40=Write protected<br />
&48=CRC error<br />
&50=Sector not found<br />
&60=Bad command<br />
&61=Bad address<br />
&63=Volume error<br />
&65=Bad drive<br />
&6F=Abort<br />
<br />
The result byte can be preloaded with a value to return if no OSWORD &72<br />
routine exists. For instance, preloading the result with &00 makes all such<br />
failed calls appear to succeed, preloading with &50 makes all calls appear<br />
to return 'Sector not found'.<br />
<br />
===Coding===<br />
The following routine can be used to perform an OSWORD &72 call. It requires<br />
X%=>15-byte control block, Y%=X%DIV256.<br />
<br />
DEFFNscsi(cmd%,addr%,num%,sect%,drv%):LOCALfs%<br />
fs%=FNfs:IFfs%<>8:*FX143,18,8<br />
X%?0=0:X%!1=addr%:X%?5=cmd%:X%?6=drv%*32+((sect%AND&1F0000)DIV65536)<br />
X%?7=((sect%AND&FF00)DIV256):X%?8=sect%:X%!9=0:X%!11=num%<br />
A%=&72:CALL&FFF1:A%=?X%:IFfs%<>8:OSCLI"FX143,18,"+STR$ fs%<br />
=A%<br />
DEFFNfs:LOCALA%,E%,Y%:=(USR&FFDA)AND&FF<br />
<br />
==Cumana Electron DFS disk access==<br />
The Cumana Double Densisty Electron DFS implments the following OSWORD &72<br />
call:<br />
On entry:<br />
XY?0 = Control byte,<br />
b0: side select 0,1<br />
b1: drive 1 select<br />
b2: drive 2 select<br />
b3: 0=double density, 1=single density<br />
XY?1 = command<br />
XY?2 = track<br />
XY?3 = sector<br />
XY?4 = data<br />
XY!5 = address<br />
XY?9 = 0, holds result on exit<br />
<br />
===Commands===<br />
&04=Seek track zero<br />
&14=Seek track<br />
&50=Step in one track<br />
&70=Step out one track<br />
&80=Read sector<br />
&A0=Write sector<br />
b0-b1=step rate 6ms/12ms/20ms/30ms<br />
<br />
===Results===<br />
XY?2=new track<br />
XY?3=new sector<br />
XY?9=result<br />
&00=Ok<br />
<br />
==See Also==<br />
* http://mdfs.net/Docs/Comp/BBC/Osword/Osword72<br />
* http://mdfs.net/Docs/Comp/BBC/Oswords<br />
<br />
[[User:Jgharston|Jgharston]] 14:06, 26 May 2009 (UTC)</div>
Abz
http://beebwiki.mdfs.net/index.php?title=OSWORD_%267F&diff=973
OSWORD &7F
2012-02-15T23:00:10Z
<p>Abz: Added Special Registers and Drive Status result</p>
<hr />
<div>[[Category:OSWORD]]<br />
{{#customtitle:OSWORD &7F (127) - Perform floppy disk operation}}<br />
__TOC__<br />
==Specification==<br />
{| cellpadding="0" cellspacing="0" <br />
| || align="left" | '''On entry:''' || align="left" | '''On exit:'''<br />
|-<br />
| colspan="3" | '''Control block'''<br />
|- align="left" valign="top"<br />
| align="center" | XY?&00 || Drive || <br />
|- align="left" valign="top"<br />
| align="center" | XY!&01 || Data address || <br />
|- align="left" valign="top"<br />
| align="center" | XY?&05 || Number of parameters (n) || <br />
|- align="left" valign="top"<br />
| align="center" | XY?&06 || Command || <br />
|- align="left" valign="top"<br />
| align="center" | XY+7... || Parameters || <br />
|- align="left" valign="top"<br />
| align="center" | XY?(7+n) || || Result<br />
|}<br />
<br />
No contents of the control block should be relied upon on exit other than<br />
the result byte. Some systems update the control block, some systems do not.<br />
<br />
{| cellpadding="0" cellspacing="0"<br />
| '''Command'''&nbsp; || '''Parameters''' || '''Meaning'''<br />
|- valign="top"<br />
| align="center" | &40 || <track> <sector> <size+count> <size> <field> || Scan data **<br />
|-<br />
| align="center" | &44 || <track> <sector> <size+count> <size> <field> || Scan data and deleted data multi-sector **<br />
|-<br />
| align="center" | &4A || <track> <sector> || Write data 128 bytes<br />
|-<br />
| align="center" | &4B || <track> <sector> <size+count> || Write data<br />
|-<br />
| align="center" | &4E || <track> <sector> || Write deleted data 128 bytes<br />
|-<br />
| align="center" | &4F || <track> <sector> <size+count> || Write deleted data<br />
|-<br />
| align="center" | &52 || <track> <sector> || Read data 128 bytes<br />
|-<br />
| align="center" | &53 || <track> <sector> <size+count> || Read data<br />
|-<br />
| align="center" | &56 || <track> <sector> || Read data and deleted data 128 bytes<br />
|-<br />
| align="center" | &57 || <track> <sector> <size+count> || Read data and deleted data<br />
|-<br />
| align="center" | &5B || <track> <&00> <count> || Read IDs<br />
|-<br />
| align="center" | &5E || <track> <sector> || Verify data and deleted data 128 bytes<br />
|-<br />
| align="center" | &5F || <track> <sector> <size+count> || Verify data and deleted data<br />
|-<br />
| align="center" | &63 || <track> <gap3> <size+count> <gap5> <gap1> &nbsp;|| Format track<br />
|-<br />
| align="center" | &64 || <track> || (EDOS) Write track<br />
|-<br />
| align="center" | &65 || <track> || (EDOS) Read track<br />
|-<br />
| align="center" | &69 || <track> || Seek<br />
|-<br />
| align="center" | &6C || &ndash; || Read drive status and reset 'not ready'<br />
|-<br />
| align="center" | &75 || <&0D> <step> <settle> <load> || Initialise<br />
|-<br />
| align="center" | &75 || <&1n> <bad 1> <bad 2> <current track> || Specify bad tracks<br />
|-<br />
| align="center" | &76 || &ndash; || (EDOS) Force interrupt<br />
|-<br />
| align="center" | &7A || <register> <value> || Write special register<br />
|-<br />
| align="center" | &7D || <register> || Read special register<br />
|-<br />
| align="center" | &E0 || <track> <nine more bytes> || (1770) Read track<br />
|-<br />
| align="center" | &F0 || <track> <nine more bytes> || (1770) Write track<br />
|}<br />
<br />
<nowiki>**</nowiki> Not possible on a BBC as needs DMA hardware.<br />
<br />
==Parameters==<br />
===Drive===<br />
The drive number specifies the drive to access. If bit 7 is set, then the<br />
previously-used drive is used, and the drive status check is skipped.<br />
<br />
The drive number can be expressed as a binary number %pxDDDdsd.<br />
* b7 : p - If 1, selects the previously-used drive and density<br />
* b5-b3 : DDD - select the drive density:<br />
: %xx0=Acorn single density<br />
: %xx1=Acorn double density<br />
: %0xx=Watford current density<br />
: %10x=Watford single density<br />
: %11x=Watford double density<br />
* b2,b0 : dd - physical drive number<br />
* b1 : s - side<br />
<br />
Single density DFSs do not have any ability to select double density disk<br />
access. Acorn DFSs select the density with b3, Watford DFSs select the<br />
density with b4 and b5. To specify a density in a manner compatible with<br />
both Acorn and Watford DFSs specify the density with both methods:<br />
<br />
%001000sd - to specify single density<br />
%001110sd - to specify double density<br />
<br />
Most DFSs do not implement physical drives numbers larger than 1 (logical<br />
drives greater than 3). Selecting the previously selected drive can only be<br />
relied upon if DFS is the currently selected filing system. A drive number<br />
of &FF should be passed to select the previously used drive.<br />
<br />
DFS 2.xx in the Master MOS 3.20 ROM incorrectly passes the density bit in b3<br />
to the drive control register b3 instead of b5, so OSWORD &7F cannot access<br />
double density disks without patching the DFS<br />
<ref>http://mdfs.net/ROMs/Filing/Disk</ref>.<br />
<br />
===Data Address===<br />
This is the address to transfer data to or from.<br />
<br />
===Track===<br />
This is the logical track to transfer data to or from. This may be different from<br />
the physical track number if the drive has previously been stepped to the correct<br />
physical track.<br />
<br />
===Sector===<br />
This is the logical sector number to start data transfer from. Sectors can be<br />
numbered anything from &00 to &FF, but single-density DFS-formatted disks use<br />
&00-&09 and double-density DFS and ADFS disks use &00-&0F.<br />
<br />
===Size + Count===<br />
Bits 0 to 4 specify the number of sectors to be read or written. Specifying<br />
zero sectors is undefined and may result in unpredictable behaviour.<br />
<br />
Bits 5 to 7 specify the sector size as 128*2^size, as follows:<br />
<br />
{| cellpadding="0" cellspacing="0" <br />
| &nbsp;b7&nbsp; || &nbsp;b6&nbsp; || &nbsp;b5&nbsp; || &nbsp;Sector size<br />
|- align="center"<br />
| 0 || 0 || 0 || align="left" | 128 bytes<br />
|- align="center"<br />
| 0 || 0 || 1 || align="left" | 256 bytes<br />
|- align="center"<br />
| 0 || 1 || 0 || align="left" | 512 bytes<br />
|- align="center"<br />
| 0 || 1 || 1 || align="left" | 1024 bytes<br />
|- align="center"<br />
| 1 || 0 || 0 || align="left" | 2048 bytes (8271 only)<br />
|- align="center"<br />
| 1 || 0 || 1 || align="left" | 4096 bytes (8271 only)<br />
|- align="center"<br />
| 1 || 1 || 0 || align="left" | 8192 bytes (8271 only)<br />
|- align="center"<br />
| 1 || 1 || 1 || align="left" | 16384 bytes (8271 only)<br />
|}<br />
<br />
===Special Registers===<br />
Command &7A and &7D write and read internal special registers. These registers are:<br />
* &00 40/80 flag (Opus) : reserved:dstep:0:0:0:0:0:0 0=single, 1=double<br />
* &03 Density (Opus) : reserved:densy:0:0:0:0:0:0 0=single, 1=double<br />
* &04 SROM (Opus) : &00-&0F<br />
* &06 Scan Sector (sector any error occured at)<br />
* &10 Bad Track Register 1 (drive 0/2)<br />
* &11 Bad Track Register 2 (drive 0/2)<br />
* &12 Track<br />
* &13 Scan Count LSB<br />
* &14 Scan Count MSB<br />
* &17 DMA Mode Register 1:1:0:0:0:0:<single head>:<no DMA><br />
* &18 Bad Track 1 (drive 1/3)<br />
* &19 Bad Track 2 (drive 1/3)<br />
* &1A Track (drive 1/3)<br />
* &22 Drive Control Input<br />
* &23 Drive Control Output SEL1:SEL0:FAULT:LOW:LOAD:DIR:SEEK:WREN<br />
<br />
What Special Registers are supported depends on the specific hardware and DFS firmware.<br />
<br />
==Result==<br />
The result is returned to the byte after the last parameter. The location is<br />
addressed by XY?(7+XY?5). For command &6C this location contains the drive<br />
status; for command &7D it is the requested special register; and for<br />
command &7A the result is undefined. Values returned by the other commands<br />
are as made up as follows:<br />
<br />
* b7-b6: always zero (1770 DFS returns 11 if command unrecognised)<br />
* b5: deleted data found<br />
* b4-b3: completion type: 00=no error, 01=recoverable error, 10=unrecoverable error, 11=failure<br />
* b2-b1: completion code<br />
* b0: always zero<br />
<br />
This gives the following result values:<br />
<br />
{| cellpadding="0" cellspacing="0" <br />
| &nbsp;type&nbsp; || &nbsp;code&nbsp; || &nbsp;Result&nbsp; || &nbsp;Meaning<br />
|- align="center"<br />
| 00 || 00 || &00 || align="left" | Successful completion<br />
|- align="center"<br />
| 00 || 01 || &02 || align="left" | Success, scan met equal **<br />
|- align="center"<br />
| 00 || 10 || &04 || align="left" | Success, scan met not equal **<br />
|- align="center"<br />
| 00 || 11 || &06 || align="left" | unused<br />
|- align="center"<br />
| 01 || 00 || &08 || align="left" | Clock error<br />
|- align="center"<br />
| 01 || 01 || &0A || align="left" | Late DMA ** / Late ISR<br />
|- align="center"<br />
| 01 || 10 || &0C || align="left" | ID CRC error<br />
|- align="center"<br />
| 01 || 11 || &0E || align="left" | Data CRC error<br />
|- align="center"<br />
| 10 || 00 || &10 || align="left" | Drive not ready<br />
|- align="center"<br />
| 10 || 01 || &12 || align="left" | Disk write protected<br />
|- align="center"<br />
| 10 || 10 || &14 || align="left" | Track 0 not found<br />
|- align="center"<br />
| 10 || 11 || &16 || align="left" | Write error<br />
|- align="center"<br />
| 11 || 00 || &18 || align="left" | Sector not found<br />
|- align="center"<br />
| 11 || 01 || &1A || align="left" | unused<br />
|- align="center"<br />
| 11 || 10 || &1C || align="left" | unused<br />
|- align="center"<br />
| 11 || 11 || &1E || align="left" | Drive not present/drive empty<br />
|-<br />
|}<br />
<br />
<nowiki>**</nowiki> Not possible on a BBC as needs DMA hardware.<br />
<br />
The result byte will have &20 added to it if deleted data has been read.<br />
<br />
Intel documentation states that result type 01 should be retried up to a<br />
total of ten times before abandoning. In practice:<br />
* results types 01 and 10, other than &10 - Drive not ready - and &12 - Disk write protected, should be retried up to ten times<br />
* result &10 should be retried indefinitely until some other result occurs<br />
* result &18 - Sector not found - could be followed by a seek to track zero then one additional attempt.<br />
* While result &1E - Drive not present/empty - is not mentioned in official documentation, if left trying to access an empty drive this result will eventually occur. As such, emulators such as BeebEm will give Disk fault 1E if trying to access an empty drive. 1770 DFSs usually return Disk error 18 (Sector not found) instead.<br />
<br />
The result byte can be preloaded with a value to return if no OSWORD &7F<br />
routine exists. For instance, preloading the result with &00 makes all such<br />
failed calls appear to succeed, preloading with &18 makes all calls appear<br />
to return 'Sector not found'. HADFS preloads the result byte with &1E to<br />
give a default result of 'Drive not present'.<br />
<br />
Read Drive Status (&6C) resets any 'not ready' error and returns the drive status as the result byte:<br />
* b7 : unused<br />
* b6 : READY1<br />
* b5 : FAULT<br />
* b4 : INDEX<br />
* b3 : WR PROTECT<br />
* b2 : READY0<br />
* b1 : TRACK0<br />
* b0 : COUNT<br />
<br />
==8271 Commands==<br />
The 8271 command passed in the control block is actually a bitmap made up as<br />
follows:<br />
+---+---+---+---+---+---+---+---+<br />
| 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | <br />
+---+---+---+---+---+---+---+---+<br />
| | | | | | | |<br />
| | +---+---+ | +---+----Size: 00 multiple scan data<br />
| | | | | 01 no transfer<br />
| | | | | 10 128 bytes<br />
| | | | | 11 multiple sectors<br />
| | | | |<br />
| | | | +------------Data: 0 ignore delete data<br />
| | | | 1 all data<br />
| | | |<br />
| | | +-----------Direction: 0 Write to FDC<br />
| | | 1 Read from FDC<br />
| | |<br />
| | +-----------------Command: 000 Scan<br />
| | 001 Read<br />
| | 010 Write<br />
| | 011 Verify<br />
| | 100 Format<br />
| | 101 Seek<br />
| | 110 Initialise<br />
| | 111 Special Registers<br />
| |<br />
| +---------------------------------- Drive<br />
+-------------------------------------- Side<br />
<br />
DFS copies the drive and side bits from the drive number passed in XY?0,<br />
and is the origin of the DFS drive numbering scheme. Bit 3 is used to<br />
select the appropriate NMI and Tube code to transfer to or from the<br />
floppy disk controller.<br />
<br />
Obviously, some combinations result in commands that are not sensible or are<br />
ineffective. For instance, it makes no sense to combine "Read" with "no<br />
transfer".<br />
<br />
==Implementation==<br />
Some DFSs, such as DFS 2.45 supplied in the Master MOS 3.50 ROM, only<br />
respond to OSWORD &7F if DFS is the current filing system and fail silently<br />
if any other filing system is selected.<br />
<br />
===Acorn DFS===<br />
This is the original implementation of OSWORD &7F. It is a fairly simple<br />
interface to the Intel 8271 floppy disc controller; it passes the command<br />
and parameters to the controller, supplies the appropriate NMI service<br />
routine to fetch or store the disc data, and returns the result.<br />
<br />
===Acorn 1770 DFS===<br />
This emulates key commands of the 8271. Software double-stepping is<br />
available. Double density access can be made by setting bit 3 of the drive<br />
number. Unfortunately, the programmers didn't realise that the double<br />
density bit was moved in the BBC Master hardware, so double density access<br />
is not possible without a patched filing system<br />
<ref>http://mdfs.net/ROMs/Filing/Disk</ref>.<br />
<br />
===Watford DDFS===<br />
Density selectable with b4-b5 of the drive number.<br />
<br />
===Opus EDOS===<br />
This emulates key commands of the 8271, and operates on each drive in the<br />
density that was detected at the last <code>*CAT</code> (single or double).<br />
Software double-stepping is enabled if <code>*OPT 8,255</code> is entered<br />
and <code>*CAT</code> detects a 40 track disc.<br />
<br />
The Format Track command formats 256-byte sectors only in single density, or<br />
double density if 16 or more sectors are specified. The density of operation<br />
cannot be directly specified to other commands.<br />
<br />
The sector size parameter is ignored in favour of the sectors' N records.<br />
<br />
==Coding==<br />
The following routine can be used to perform an OSWORD &7F call that takes<br />
three parameters, such as Write (&4B) and Read (&53), or Track Read (&E0)<br />
and Track Write (&F0) which take ten parameters. It requires <code>X%</code>=>15-byte<br />
control block, <code>Y%=X%DIV256</code>. <code>den%=1</code> for single<br />
density and, if supported by the hardware, <code>den%=2</code> for double density.<br />
<br />
DEFFNdisk(addr%,cmd%,drv%,trk%,sec%,num%,den%):LOCAL fs%<br />
fs%=FNfs:IF fs%<>4:*FX143,18,4<br />
REPEAT<br />
X%?0=drv%+den%*24+8:X%!1=addr%:X%?5=3-7*(cmd%>127)<br />
X%?6=cmd%:X%?7=trk%:X%?8=sec%:X%?9=num%OR&20<br />
A%=127:CALL&FFF1:A%=X%?(X%?5+7)<br />
UNTIL A%<>&10:IF fs%<>4:OSCLI"FX143,18,"+STR$ fs%<br />
=A%<br />
DEFFNfs:LOCAL A%,E%,Y%:=(USR&FFDA)AND&FF<br />
<br />
==Tube note==<br />
The Tube MOS copies a 16-byte control block over the Tube, so on a read<br />
operation, any data read to immediately after the control block will be<br />
overwitten by the returned control block if it is within 16 bytes of the<br />
start of the control block.<br />
<br />
If code is to run properly, the destination address of any reads must be at<br />
least 16 bytes away from the start of the control block, for example:<br />
DIM X% 15, T% 255<br />
Y% = X% DIV 256<br />
X%!1 = T%<br />
etc...<br />
<br />
If blocks are declared with variables in the heap, the variable definitions<br />
count towards the 16-byte distance, so the following is ok:<br />
DIM ctrl% 12, data% 255<br />
X%=ctrl%:Y%=X% DIV 256<br />
X%!1 = data%<br />
etc...<br />
<br />
As the variable <code>data%</code> is assigned space between the two<br />
buffers, the value of <code>data% - ctrl%</code> exceeds 15.<br />
<br />
==See Also==<br />
* http://mdfs.net/Docs/Comp/BBC/Osword/Osword7F<br />
* http://mdfs.net/Docs/Comp/BBC/Osword/DFSOsword<br />
* [[OSWORD &72]]<br />
* [[OSWORD &62]]<br />
<br />
==References==<br />
<references /></div>
Abz
http://beebwiki.mdfs.net/index.php?title=FSCV&diff=277
FSCV
2012-01-09T03:19:55Z
<p>Abz: Reformatted parameters, added TubeHost and extension details.</p>
<hr />
<div>[[Category:MOS_API]]<br />
Filing system control<br />
<br />
==Specification==<br />
This vector is only called by the operating system, and should not be called<br />
directly. This list just shows the full list of calls.<br />
<br />
==Specification==<br />
{| cellpadding="0" cellspacing="0"<br />
| &nbsp; || align="left" | '''On entry:''' || align="left" | '''On exit:'''<br />
|- align="center" valign="top"<br />
| A || align="left" | = function code || Return value, or preserved if function not supported<br />
|- align="center" valign="top"<br />
| X,Y || align="left" | =>command string or byte parameters&nbsp;&nbsp; || align="left" | Any returned data<br />
|}<br />
<br />
{| cellpadding="0" cellspacing="1" <br />
| colspan="2" | '''Functions'''<br />
|-<br />
| valign="top" | &00 || *OPT command. X and Y hold parameters.<br />
|-<br />
| valign="top" | &01 || EOF on channel Y being checked with OSBYTE &7F. On exit, X=&FF if EOF, X=&00 otherwise. If Y=&00, (ie, EOF#0) action is implementation specific.<br />
|-<br />
| valign="top" | &02 || */ command. XY points to the command text.<br />
|-<br />
| valign="top" | &03 || Unrecognised OSCLI. XY points to the command text. The command has already been offered to the [[paged ROM]]s via [[Paged ROM service calls|service call]] &04, and none have responded.<br />
|-<br />
| valign="top" | &04 || *RUN command. XY points to filename.<br />
|-<br />
| valign="top" | &05 || *CAT command. XY points to any pathname.<br />
|-<br />
| valign="top" | &06 || A new filing system is about to take over. This call is generated by filing systems themselves before they start their initialisation.<br />
|-<br />
| valign="top" | &07 || File handle range request. Lowest returned in X, highest in Y. <br />
|-<br />
| valign="top" | &08 || OSCLI command being processed. This is used to facilitate the *ENABLE command.<br />
|-<br />
| valign="top" | &09 || *EX command. XY points to any pathname.<br />
|-<br />
| valign="top" | &0A || *INFO command. XY points to the object name.<br />
|-<br />
| valign="top" | &0B || *RUN from library. XY points to the filename.<br />
|-<br />
| valign="top" | &0C || *RENAME command. XY points to the object names after the command.<br />
|}<br />
===Extensions===<br />
FSCV can be extended (eg by TubeHost) so that any other calls <&80 pass a string pointed to by X,Y, and calls >&7F pass and receive two bytes of data in X,Y.<br />
{| cellpadding="0" cellspacing="1" <br />
| colspan="2" | '''Functions'''<br />
|-<br />
| valign="top" | &FF || Startup, Y=0 to boot filing system, Y<>0 for no boot. X=default return value, &00 for no action.<br />
|}<br />
<br />
==Calling from BBC BASIC==<br />
* <code>=EOF#ch</code> on 8-bit systems calls [[OSBYTE &7F|OSBYTE 127]], which calls FSC &01.<br />
<br />
==Special handles==<br />
Z88 allows:<br />
* <code>=EOF#-1</code>, returns -1 for expanded and 0 for unexpanded.<br />
<br />
==Entry points==<br />
There is no entry point to FSC. It is called by other parts of the system in<br />
response to other calls, and should not be called directly via the vector.<br />
<br />
==Implementations==<br />
* *OPT 0 - resets options to default values.<br />
* *OPT 1 - set message reporting level<br />
* *OPT 2<br />
* *OPT 3<br />
* *OPT 4,n specify boot option<br />
* *OPT 5<br />
* *OPT 6<br />
* *OPT 7<br />
* *OPT 40,d - some systems implement *OPT40,d to select double-stepping on drive d.<br />
* *OPT 80,d - some systems implement *OPT80,d to select single-stepping on drive d.<br />
<br />
* [http://mdfs.net/Tube/Serial TubeHost] implements FSC &FF so that a client filing system can indicate a Shift-Break or a Tube Client Startup has occured.<br />
<br />
Some systems search the only current directory with *RUN and search the current directory and the current library library with */name and *name.<br />
<br />
[[User:Abz|Abz]] 03:19, 9 January 2012 (UTC)</div>
Abz
http://beebwiki.mdfs.net/index.php?title=API&diff=71
API
2012-01-09T03:05:05Z
<p>Abz: Updated 80x86.</p>
<hr />
<div>[[Category:MOS_API]]__NOTOC__<br />
===MOS Calls===<br />
*[[OSCLI]] Execute *command<br />
*[[OSBYTE]] Various byte-wise functions<br />
*[[OSWORD]] Various functions with control block data<br />
<br />
===Character I/O===<br />
*[[OSWRCH]] Send a character to output stream<br />
*[[OSWRCR]] Send a CR to output stream<br />
*[[OSNEWL]] Send a NewLine to output stream<br />
*[[OSASCI]] Send an ASCII sequence to output stream<br />
*[[OSRDCH]] Wait for a character from input stream<br />
<br />
===Filing System Calls===<br />
*[[OSFILE]] Operate on whole files<br />
*[[OSARGS]] Read and write information on open files and filing systems<br />
*[[OSBGET]] Read a byte from a channel<br />
*[[OSBPUT]] Write a byte to a channel<br />
*[[OSGBPB]] Read or write blocks of data<br />
*[[OSFIND]] Open or close files<br />
<br />
===Vectors===<br />
*[[FSCV]] Low-level filing system control<br />
<br />
===Miscellaneous Calls===<br />
*[[NVWRCH]] Nonvectored OSWRCH, points to default contents of WRCHV<br />
*[[NVRDCH]] Nonvectored OSRDCH, points to default contents of RDCHV<br />
*[[GSREAD]] General String Reading<br />
*[[GSINIT]] General String Initialisation<br />
*[[OSEVEN]] Generate events<br />
*[[VDUCHR]] Send a character to VDU drivers<br />
*[[OSRDSC]] Read a byte from paged/banked memory<br />
*[[DEFVEC]] Pointer to default vector table<br />
*[[OSWRSC]] Write a byte to screen memory<br />
<br />
===MOS API Entry Points on various platforms===<br />
<pre><br />
| 6502 | Z80 | 6809 | PDP11 | 80x86 | 32016 | ARM |<br />
| vector| vector| vector| entry | entry vector | | entry vector |<br />
| | | | | | | |<br />
* IRQV | &FFFE | &FFEE | | | | | |<br />
* RSTV | &FFFC | | | | | | |<br />
* NMIV | &FFFA | | | | | | |<br />
| | | | | | | |<br />
* USERV | &0200 | | | | | | |<br />
* ERROR | BRK |RST &38| SWI | EMT 15 | INT &4F (0000:013C) | | SWI &2B "OS_GenerateError" |<br />
* BRKV | &0202 | &FFFA | &FFFA | | (0000:05F8) | | |<br />
* IRQ1V | &0204 | | | | | | |<br />
* IRQ2V | &0206 | &FFB1 | &FFB1 | | | | |<br />
* FAULT | &00FD | &FF82 | &FF82 | | (0000:05F4) | | |<br />
* ESCFLG | &00FF | &FF80 | &FF80 | | (0000:05F0) | | |<br />
| | | | | | | |<br />
* QUIT | | | | EMT 0 | | SVC &11 | SWI &11 "OS_Exit" |<br />
| | | | | | | |<br />
===MOS Calls=== | | | | | | | |<br />
* OSCLI &FFF7 | &0208 | &FFF8 | &FFF8 | EMT 1 | INT &4C (0000:0130) | SVC &08 | SWI &05 "OS_CLI" &05 |<br />
* OSBYTE &FFF4 | &020A | &FFF5 | &FFF5 | EMT 2 | INT &4B (0000:012C) | SVC &06 | SWI &06 "OS_Byte" &06 |<br />
* OSWORD &FFF1 | &020C | &FFF2 | &FFF2 | EMT 3 | INT &4A (0000:0128) | SVC &07 | SWI &07 "OS_Word" &07 |<br />
| | | | | | | |<br />
===Character I/O===| | | | | | | |<br />
* OSWRCH &FFEE | &020E | &FFEF | &FFEF | EMT 4 | INT &49 (0000:0124) | SVC &01 | SWI &00 "OS_WriteC" &03 |<br />
* OSWRCR &FFEC | | | | | | | |<br />
* OSNEWL &FFE7 | | | | EMT 5 | INT &48 (0000:0120) | SVC &04 | SWI &03 "OS_NewLine" |<br />
* OSASCI &FFE3 | | | | | INT &47 (0000:011C) | SVC &03 | |<br />
* OSRDCH &FFE0 | &0210 | &FFE1 | &FFE1 | EMT 6 | INT &46 (0000:0118) | SVC &05 | SWI &04 "OS_ReadC" &04 |<br />
| | | | | | | |<br />
===Filing System Calls=== | | | | | | |<br />
* OSFILE &FFDD | &0212 | &FFDE | &FFDE | EMT 7 | INT &45 (0000:0114) | SVC &0A | SWI &08 "OS_File" &08 |<br />
* OSARGS &FFDA | &0214 | &FFDB | &FFDB | EMT 8 | INT &44 (0000:0110) | SVC &0C | SWI &09 "OS_Args" &09 |<br />
* OSBGET &FFD7 | &0216 | &FFD8 | &FFD8 | EMT 9 | INT &43 (0000:010C) | SVC &0D | SWI &0A "OS_BGet" &0A |<br />
* OSBPUT &FFD4 | &0218 | &FFD5 | &FFD5 | EMT 10 | INT &42 (0000:0108) | SVC &0E | SWI &0B "OS_BPut" &0B |<br />
* OSGBPB &FFD1 | &021A | &FFD2 | &FFD2 | EMT 11 | INT &41 (0000:0104) | SVC &0F | SWI &0C "OS_GBPB" &0C |<br />
* OSFIND &FFCE | &021C | &FFCF | &FFCF | EMT 12 | INT &40 (0000:0100) | SVC &0B | SWI &0D "OS_Find" &0D |<br />
* FSCV | &021E | | | | | | SWI &0F "OS_FSControl" &29 |<br />
| | | | | | | |<br />
* NVWRCH &FFCB | | | | | | | |<br />
* NVRDCH &FFC8 | | | | | | | |<br />
* GSREAD &FFC5 | | | | | | | |<br />
* GSINIT &FFC2 | | | | | | | |<br />
* OSEVENT &FFBF | &0220 | &FFFC | &FFFC | | | | |<br />
* VDUCHR &FFBC | | | | | | | |<br />
* OSRDSC &FFB9 | | | | | | | |<br />
* DEFVEC &FFB6 | | | | | | | |<br />
* OSWRSC &FFB3 | | | | | | | |<br />
| | | | | | | |<br />
* UPTV | &0222 | | | | | | |<br />
* NETV | &0224 | | | | | | |<br />
* VDUV | &0226 | | | | | | |<br />
* KEYV | &0228 | | | | | | |<br />
* INSV | &022A | | | | | | |<br />
* REMV | &022C | | | | | | |<br />
* CNPV | &022E | | | | | | |<br />
* USR1V | &0230 | | | | | | |<br />
* USR2V | &0232 | | | | | | |<br />
* USR3V | &0234 | | | | | | |<br />
</pre><br />
<br />
[[User:Abz|Abz]] 03:05, 9 January 2012 (UTC)</div>
Abz
http://beebwiki.mdfs.net/index.php?title=Handles&diff=311
Handles
2011-10-02T23:31:28Z
<p>Abz: </p>
<hr />
<div>[[Category:Filing]]<br />
===Summary===<br />
CFS &01-&02 HADFS &19-&1D VFS &50-&59 BEEBITFS &B0-&BF<br />
ROMFS &03 LanManFS &20-&23 RAMFS &60-&64 COPROFS &C0-&CC<br />
TFS &0E-&0F NFS &20-&27 ARAMFS &60-&65 IEEEFS &F0-&FF<br />
DFS &11-&15 ANFS &20-&2F HOSTFS &80-&9F NEXUSFS<br />
HDFS &12-&17 ADFS &30-&39 IOFS &80-&9F<br />
SRAMFS &16-&18 DOSFS &40-&47 LINKFS &A0-&AF<br />
<br />
===Full List===<br />
&00 0 No opened file &50 80 VFS &B0 176 BeebItFS<br />
&01 1 CFS (in) &51 81 VFS &B1 177 BeebItFS<br />
&02 2 CFS (out) &52 82 VFS &B2 178 BeebItFS<br />
&03 3 ROMFS &53 83 VFS &B3 179 BeebItFS<br />
&04 4 &54 84 VFS &B4 180 BeebItFS<br />
&05 5 &55 85 VFS &B5 181 BeebItFS<br />
&06 6 &56 86 VFS &B6 182 BeebItFS<br />
&07 7 &57 87 VFS &B7 183 BeebItFS<br />
&08 8 &58 88 VFS &B8 184 BeebItFS<br />
&09 9 &59 89 VFS &B9 185 BeebItFS<br />
&0A 10 &5A 80 &BA 186 BeebItFS<br />
&0B 11 &5B 91 &BB 187 BeebItFS<br />
&0C 12 &5C 92 &BC 188 BeebItFS<br />
&0D 13 &5D 93 &BD 189 BeebItFS<br />
&0E 14 TFS &5E 94 &BE 190 BeebItFS<br />
&0F 15 TFS &5F 95 &BF 191 BeebItFS<br />
<br />
&10 16 &60 96 Acacia RAMFS, RAMFS &C0 192 COPROFS<br />
&11 17 DFS &61 97 Acacia RAMFS, RAMFS &C1 193 COPROFS<br />
&12 18 DFS, HDFS &62 98 Acacia RAMFS, RAMFS &C2 194 COPROFS<br />
&13 19 DFS, HDFS &63 99 Acacia RAMFS, RAMFS &C3 195 COPROFS<br />
&14 20 DFS, HDFS &64 100 Acacia RAMFS, RAMFS &C4 196 COPROFS<br />
&15 21 DFS, HDFS &65 101 Acacia RAMFS &C5 197 COPROFS<br />
&16 22 Sprow RAMFS, HDFS &66 102 &C6 198 COPROFS<br />
&17 23 Sprow RAMFS, HDFS &67 103 &C7 199 COPROFS<br />
&18 24 Sprow RAMFS .. &C8 200 COPROFS<br />
&19 25 HADFS .. &C9 201 COPROFS<br />
&1A 26 HADFS &7A 122 &CA 202 COPROFS<br />
&1B 27 HADFS &7B 123 &CB 203 COPROFS<br />
&1C 28 HADFS &7C 124 &CC 204 COPROFS<br />
&1D 29 HADFS &7D 125 &CD 205 <br />
&1E 30 &7E 126 &CE 206 <br />
&1F 31 &7F 127 &CF 207 <br />
<br />
&20 32 NFS, ANFS, LanManFS &80 128 IOFS, HostFS &D0 208<br />
&21 33 NFS, ANFS, LanManFS &81 129 IOFS, HostFS &D1 209<br />
&22 34 NFS, ANFS, LanManFS &82 130 IOFS, HostFS &D2 210<br />
&23 35 NFS, ANFS, LanManFS &83 131 IOFS, HostFS &D3 211<br />
&24 36 NFS, ANFS &84 132 IOFS, HostFS &D4 212<br />
&25 37 NFS, ANFS &85 133 IOFS, HostFS &D5 213<br />
&26 38 NFS, ANFS &86 134 IOFS, HostFS &D6 214<br />
&27 39 NFS, ANFS &87 135 IOFS, HostFS &D7 215<br />
&28 40 ANFS &88 136 IOFS, HostFS &D8 216<br />
&29 41 ANFS &89 137 IOFS, HostFS &D9 217<br />
&2A 42 ANFS &8A 138 IOFS, HostFS &DA 218<br />
&2B 43 ANFS &8B 139 IOFS, HostFS &DB 219<br />
&2C 44 ANFS &8C 140 IOFS, HostFS &DC 220<br />
&2D 45 ANFS &8D 141 IOFS, HostFS &DD 221<br />
&2E 46 ANFS &8E 142 IOFS, HostFS &DE 222<br />
&2F 47 ANFS &8F 143 IOFS, HostFS &DF 223<br />
<br />
&30 48 ADFS &90 144 IOFS, HostFS &E0 224<br />
&31 49 ADFS &91 145 IOFS, HostFS &E1 225<br />
&32 50 ADFS &92 146 IOFS, HostFS &E2 226<br />
&33 51 ADFS &93 147 IOFS, HostFS &E3 227<br />
&34 52 ADFS &94 148 IOFS, HostFS &E4 228<br />
&35 53 ADFS &95 149 IOFS, HostFS &E5 229<br />
&36 54 ADFS &96 150 IOFS, HostFS &E6 230<br />
&37 55 ADFS &97 151 IOFS, HostFS &E7 231<br />
&38 56 ADFS &98 152 IOFS, HostFS &E8 232<br />
&39 57 ADFS &99 153 IOFS, HostFS &E9 233<br />
&3A 58 &9A 154 IOFS, HostFS &EA 234<br />
&3B 59 &9B 155 IOFS, HostFS &EB 235<br />
&3C 60 &9C 156 IOFS, HostFS &EC 236<br />
&3D 61 &9D 157 IOFS, HostFS &ED 237<br />
&3E 62 &9E 158 IOFS, HostFS &EE 238<br />
&3F 63 &9F 159 IOFS, HostFS &EF 239<br />
<br />
&40 64 DOSFS &A0 160 LFS &F0 240 IEEEFS<br />
&41 65 DOSFS &A1 161 LFS &F1 241 IEEEFS<br />
&42 66 DOSFS &A2 162 LFS &F2 242 IEEEFS<br />
&43 67 DOSFS &A3 163 LFS &F3 243 IEEEFS<br />
&44 68 DOSFS &A4 164 LFS &F4 244 IEEEFS<br />
&45 69 DOSFS &A5 165 LFS &F5 245 IEEEFS<br />
&46 70 DOSFS &A6 166 LFS &F6 246 IEEEFS<br />
&47 71 DOSFS &A7 167 LFS &F7 247 IEEEFS<br />
&48 72 &A8 168 LFS &F8 248 IEEEFS<br />
&49 73 &A9 169 LFS &F9 249 IEEEFS<br />
&4A 74 &AA 170 LFS &FA 250 IEEEFS<br />
&4B 75 &AB 171 LFS &FB 251 IEEEFS<br />
&4C 76 &AC 172 LFS &FC 252 IEEEFS<br />
&4D 77 &AD 173 LFS &FD 253 IEEEFS<br />
&4E 78 &AE 174 LFS &FE 254 IEEEFS<br />
&4F 79 &AF 175 LFS &FF 255 IEEEFS<br />
<br />
===Special cases===<br />
Some systems allow reading and writing to channel 0 to read and write to<br />
OSRDCH and OSWRCH. Some C compilers direct reading from channel 0 to STDIN<br />
(via OSRDCH) and writing to channels 1 and 2 to STDOUT and STDERR (via<br />
OSWRCH).<br />
<br />
===Notes===<br />
CoProFS is documented as using &C0-&C4, but actually will use as many as its<br />
workspace allows, up to &C0-&CC.<br />
<br />
RetroClinic RAMFS uses &60-&64, Acacia RAMFS uses &60-&65.<br />
<br />
Early versions of HADFS used &05-&0A and &85-&8A to read/write control<br />
information, later versions use &19-&1D to access this control information.<br />
<br />
IOFS in BBCTerm uses handles &80-&9F but its OSFSC entry reports that it<br />
uses &80-&A0. IOFS also incorrectly reports its filing system number as &00.<br />
<br />
LanManFS clashes with NFS/ANFS, but the hardware cannot be present at the<br />
same time and the LanManFS Ethernet card plugs into the Econet card sockets.<br />
<br />
===References===<br />
* Advanced BBC User Guide<br />
* New Advanced BBC User Guide<br />
* Advanced Electron User Guide (RAMFS)<br />
* http://mdfs.net/Docs/Comp/BBC/Filing/Handles<br />
<br />
[[User:Jgharston|Jgharston]] 22:14, 1 September 2007 (BST)</div>
Abz