h6. [[OS SWI Calls]] h6(. » [[OS_UpCall]] h6((. » OS_UpCall 1 h2. OS_UpCall 1 h5. (SWI &33) |_<^{width:4em}. Entry | | |<^. R0 |<^. 1| |<^. R1 |<^. [[Filing System Numbers|Filing system number]]| |<^. R2 |<^. Pointer to media name| |<^. R3 |<^. Device number| |<^. R4 |<^. Iteration count| |<^. R5 |<^. Timeout delay| |<^. R6 |<^. Pointer to media type| |_<^{width:4em}. Exit | | |<^. R0 |<^. 0 if medium change, or -1 if medium no longer required, else preserved| |<^. R1 |<^. Preserved| |<^. R2 |<^. Preserved| |<^. R3 |<^. Preserved| |<^. R4 |<^. Preserved| |<^. R5 |<^. Preserved| |<^. R6 |<^. Preserved| h4. Use The purpose of this call is to warn applications that a filing medium is not present. h4. Notes This Upcall is called when a media change (e.g. another disc) is required. The following information applies to both OS_UpCall 1 & [[OS_UpCall 2]]. Any routines on this vector should: * Prompt you to supply the medium with a string built up using: # The medium type string (passed in R6) #the filing system name (obtained by calling [[OS_FSControl 33|XOS_FSControl 33]] acting on the value of R1) # The medium name (passed in R2), for example: 'Please insert disc ADFS:XYZ and press Space (Escape to abort)' * Give you a way of indicating that you have either supplied the medium, or wish to cancel the operation * Intercept the vector with R0 = -1 if you wish to cancel the operation * Intercept the vector with R0 = 0 if the time limit is reached, or if you say you have supplied the medium When you intercept the call to the vector, control passes back to the filing system routine that called [[OS_UpCall]]... * If R0 = -1, then the routine calls [[OS_UpCall 4]]; it then returns an error to say that the medium wasn't found. * If R0 = 0, then the routine checks for you that the medium has been changed and the correct one supplied. If so, it calls OS_UpCall 4; otherwise it just calls OS_UpCall 1 or [[OS_UpCall 2]] again, after incrementing R4 The timeout period in R5 is set to a small value for media that can detect when the medium has been changed (such a floppy disc drives) and to a large value (typically &FFFFFFFF) for other media. In the former case, this means that RISC OS will automatically detect that a new medium has been supplied, and check that it is the correct one. If R1 is unchanged on exit, nobody handled the request. In general, this should be treated by filing systems as the media not present error. The most common use of OS_UpCall 1 and 2 are to request that a floppy disc is inserted. h4. See also * [[Filing System Numbers]] * [[OS_UpCall]] * [[OS_UpCall 2]] * [[OS_UpCall 4]] * [[OS_FSControl 33|XOS_FSControl33]]