- PXELINUX: Support changing the default server and downloading files
from a non-default server.
-- MEMDISK: Support read only mode.
-
*** Debugging projects:
; A program to emulate an INT 13h disk BIOS from a "disk" in extended
; memory.
;
-; Copyright (C) 2001-2003 H. Peter Anvin
+; Copyright (C) 2001-2004 H. Peter Anvin
;
; This program is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
ret
Write:
+ test byte [ConfigFlags],01h
+ jnz .readonly
call setup_regs
xchg esi,edi ; Opposite direction of a Read!
jmp short do_copy
+.readonly: mov ah,03h ; Write protected medium
+ ret
; Verify integrity; just bounds-check
Verify:
DriveNo db 0 ; Our drive number
DriveType db 0 ; Our drive type (floppies)
DriveCnt db 0 ; Drive count (from the BIOS)
- db 0 ; Pad
+
+ConfigFlags db 0 ; Bit 0 - readonly
MyStack dw 0 ; Offset of stack
StatusPtr dw 0 ; Where to save status (zeroseg ptr)
[*] MS-DOS only allows max 255 heads, and only allows 255 cylinders
on floppy disks.
-If you want to recompile it from sources, you will need to make sure that
-you have a fairly recent binutils installed. I have been using the
-binutils-2.11.90.0.8-9 RPM from RedHat.
+c) The disk is normally writable (although, of course, there is
+nothing backing it up, so it only lasts until reset.) If you want,
+you can mimic a write-protected disk by specifying the command line
+option:
+
+ ro Disk is readonly
Some interesting things to note:
#ident "$Id$"
/* ----------------------------------------------------------------------- *
*
- * Copyright 2001-2003 H. Peter Anvin - All Rights Reserved
+ * Copyright 2001-2004 H. Peter Anvin - All Rights Reserved
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
uint8_t driveno;
uint8_t drivetype;
uint8_t drivecnt;
- uint8_t _pad1;
+ uint8_t configflags;
+#define CONFIG_READONLY 0x01
uint16_t mystack;
uint16_t statusptr;
pptr->disksize = geometry->sectors;
pptr->diskbuf = ramdisk_image + geometry->offset;
pptr->statusptr = (geometry->driveno & 0x80) ? 0x474 : 0x441;
+ pptr->configflags = 0;
+
+ /* Readonly? */
+ if ( getcmditem("ro") != CMD_NOTFOUND ) {
+ printf("Marking disk readonly\n");
+ pptr->configflags |= CONFIG_READONLY;
+ }
/* Set up a drive parameter table */
if ( geometry->driveno & 0x80 ) {