aboutsummaryrefslogtreecommitdiffstats
path: root/memdisk
Commit message (Collapse)AuthorAgeFilesLines
* memdisk: make "nopass" type-specific, add "nopassany"H. Peter Anvin2010-02-081-4/+11
| | | | | | | Make "nopass" specific to the current drive type. Add new option "nopassany", which also clobbers the drive counts of both types. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: fix non-prototype function declarationH. Peter Anvin2010-01-101-1/+1
| | | | | | () is not a prototype, use (void) Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Makefile: replace -W -Wall with centralized $(GCCWARN)H. Peter Anvin2010-01-101-1/+1
| | | | | | | | | Replace -W -Wall hardcoded into a bunch of Makefiles with $(GCCWARN), a centralized variable defined in the root MCONFIG. Add -Wstrict-prototypes to the list of global warnings: we should never have non-prototyped declarations. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: Fix "might be used uninitialized" warningShao Miller2009-12-111-2/+2
| | | | | | | Impact: Initializing variables The checksum_buf function was providing an incorrect checksum on at least one build.
* memdisk: Fix mBFT alignmentShao Miller2009-12-111-1/+1
| | | | | | | Impact: Fixing mBFT alignment It was previously possible that the mBFT might not be 16-byte aligned because the .data section was not.
* memdisk: slight cleanup of the "safe hook" structureH. Peter Anvin2009-12-071-2/+1
| | | | | | Make the "safe hook" structure code a bit more readable. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: "safe hook" and mBFTShao Miller2009-12-073-4/+136
| | | | | | | | | | | | | | | | | | | | Two additions to MEMDISK to support OS drivers. The "safe hook" structure ("Safe Master Boot Record INT 13h Hook Routines") is a means for an OS driver to follow a chain of INT 13h hooks, examining the hooks' vendors and assuming responsibility for hook functionality along the way. For MEMDISK, we guarantee an additional field which holds the physical address for the mBFT. The mBFT is an ACPI table which an OS driver can scan for. The mBFT contains the official MEMDISK Info structure (MDI) which itself includes parameters the OS will want to know about. The mBFT points back at the "safe hook" structure's physical address so that an OS supporting both "safe hook" chain-walking as well as mBFT-scanning can know that both refer to the same MEMDISK instance. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: pptr->cd_pkt.sect_count is in virtual sectorsH. Peter Anvin2009-11-191-1/+1
| | | | | | | Per the El Torito spec, pptr->cd_pkt.sect_count are in virtual sectors, i.e. 512-byte sectors. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: Use boot_lba logic for booting an offset within the disk imageShao Miller2009-11-191-8/+9
| | | | | | | | | We have two fundamental quantities: the offset of the disk image itself and the LBA from which we boot. Keep them straight. This should make at least some no-emulation isos work correctly. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: Restore DL for INT 13h, AH=15h, DL=floppysyslinux-3.84-pre4Shao Miller2009-11-191-1/+3
| | | | | | | | | | At least PC-DOS requires this to avoid an infinite loop; the DL we restore is not the same DL that we call the underlying BIOS with, but rather the original one (before the decrement.) PC-DOS loops over all the floppies and relies on the call preserving DL in order to advance the loop. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Merge branch 'memdisk-iso-SAFE' into memdisk-isoShao Miller2009-11-1614-102/+624
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: memdisk/memdisk_chs.asm memdisk/memdisk_edd.asm memdisk/setup.c Resolved: Deleted memdisk/memdisk_chs.asm Deleted memdisk/memdisk_edd.asm Modified memdisk/setup.c
| * [memdisk] Add El Torito emulation for .ISO imagesShao Miller2009-08-039-18/+347
| | | | | | | | | | With this patch, users can now boot El Torito-bootable .ISO (CD/DVD) images. The user should specify "iso" on the kernel command-line.
| * [memdisk] Add installable INT 13h hooks for ISO-booting scenariosShao Miller2009-08-034-2/+18
| | | | | | | | | | | | | | As of this commit, these hooks do nothing special and are unused. They are intended to support the El Torito "No Emulation" (2048-byte sector size) and "Floppy Emulation"/"HDD Emulation" (512-byte sector size) modes for bootable optical disc drive media (CD/DVD).
| * [memdisk] Move sector size choice into each individual hookShao Miller2009-08-033-1/+2
| |
| * [memdisk] Rename CHS and EDD hooks to describe their sector sizeShao Miller2009-08-034-12/+12
| | | | | | | | Suffixed with _512 to indicate a sector size of 512 bytes.
| * [memdisk] Add disk probing code to support a drive shifting limitShao Miller2009-08-034-2/+145
| | | | | | | | | | | | | | Our INT 13h hook will now only shift BIOS drive numbers up to a limit. This limit is found by probing for a contiguous range of BIOS drives. Anything above this range of contiguous drive numbers is not shifted, and will thus be available to callers at the same drive number.
| * [memdisk] Add drive shift limit logicShao Miller2009-08-032-0/+17
| | | | | | | | | | | | | | We will not shift drives greater than or equal to a maximum BIOS drive number. This is hard-coded to drive 0xFF for now. This addition is in support of future disk probing logic, which can decide what the drive shift limit should be.
| * [memdisk] Move BIOS Data Area access into its own fileShao Miller2009-08-032-71/+85
| | | | | | | | New file: bda.h
* | MEMDISK: generate map filessyslinux-3.83-pre7H. Peter Anvin2009-08-173-0/+3
| | | | | | | | | | | | Generate map files to make debugging less painful. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* | memdisk: make the stack size configurableH. Peter Anvin2009-08-171-7/+29
|/ | | | | | | Make it possible to configure the stack size on the command line, so that we can rule that out in case of problems. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: remove unnecessary %ifdefsyslinux-3.83-pre6H. Peter Anvin2009-08-021-4/+0
| | | | Remove an %ifdef that the macros take care of anyway.
* memdisk: don't set CX:DX for INT 13h AH=15h for floppiesH. Peter Anvin2009-08-022-5/+54
| | | | | | | | | Win98SE DOS apparently hangs if INT 13h, AH=15h returns the capacity in CX:DX for floppies... *unless* EDD is enabled. Confused yet? This patch also adds some more tracing framework. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* MEMDISK: additional EDD DPT FieldsMiller, Shao2009-08-021-2/+2
| | | | | | We incorrectly used "equ" instead of "dd" (or "db") for strings in memdisk.inc. Oops! My mistake in my 'freedos' branch. Silly mistake. - Shao
* memdisk: correct the types for the EDD DPT, and write a real onesyslinux-3.83-pre5H. Peter Anvin2009-07-312-27/+41
| | | | | | | Fix the sizes of some of the fields in the EDD DPT. Write a real one to the best of our ability. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: don't write the EDD DPT unless we are in EDD mode...H. Peter Anvin2009-07-311-6/+8
| | | | | | | | | | Don't write the EDD DPT unless we're actually in EDD mode! Otherwise we end up corrupting memory beyond the defined code. This was the reason 5ca2764460883f5e9a5bd83db00f242ea1272e33 worked, by moving variables out of the corruption zone. Debugged-by: Shao Miller <Shao.Miller@yrdsb.edu.on.ca> Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* [memdisk] Additional EDD Device Parameter Table fieldsShao Miller2009-07-312-0/+20
| | | | | | Some additional fields from the EDD-4 spec. draft for the Device Parameter Table have been added into the structure in setup.c and memdisk.inc. These were added in the hopes of resolving a FreeDOS MEMDISK bug on IBM ThinkPads.
* memdisk: move temporary variables away from the EDD data blockH. Peter Anvin2009-07-301-6/+6
| | | | | | | | | | Move a couple of variables away from the EDD data block. Without this change, FreeDOS doesn't boot on Thinkpads. Unfortunately, this should have been a null change, so it is really not clear why this happens. Stack overflows have been ruled out. Probably need to examine the FreeDOS kernel in some detail. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: handle recursive INT 13h invocationH. Peter Anvin2009-07-301-12/+52
| | | | | | | | | | | | | | Some systems, e.g. a lot of Thinkpads, invoke INT 13h recursively from within the stack itself. This is generally a bad idea as it re-runs any INT 13h hooks (including the ones that DOS installs!), but it should work. Keep a counter of recursive invocations and simply bypass the whole system including the DL shift if the invocation is recursive. With this, MS-DOS boots on a Thinkpad T61. FreeDOS is still broken, though, but apparently in a different manner... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: don't use the stack before bootstrapH. Peter Anvin2009-06-091-2/+1
| | | | | | | | Under some certain circumstances, it might not be safe to use the stack as it was set up, so use a jump instead of a call to invoke the bootstrap. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: additional cleanupsH. Peter Anvin2009-06-076-88/+87
| | | | | | | | | | | | Additional stylistic cleanups. Rename "syscall" to "intcall" (we can't call it __intcall without clashing with com32.h); use macros instead of copying variables to different places with only the type being different. Also, only change the rm/pm jump instructions when actually relocating the code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: add missing memmove.SH. Peter Anvin2009-06-071-0/+139
| | | | | | We need memmove.S in the memdisk directory... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: minor cleanupsH. Peter Anvin2009-06-076-58/+71
| | | | | | | Minor cleanups to the source base; make die() also print an error message and move die() into conio.c. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: relocate real-mode code before bootingH. Peter Anvin2009-06-074-43/+115
| | | | | | | | | | Relocate the real-mode code before booting. This allows the target bootstrap to be loaded at an arbitrary address, not necessarily 0x7c00, and to be almost arbitrarily long. Add some initial infrastructure for other bootstrap addresses, too. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: move rm_args initialization to C code; export rm_sizeH. Peter Anvin2009-06-074-20/+21
| | | | | | | | Move the rm_args initialization (and the associated sti) to C code. Export the total size of the real-mode code to the protected-mode code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: set up a limited-size real-mode stackH. Peter Anvin2009-06-071-1/+4
| | | | | | | Limit the size of the real-mode stack. This should limit the amount of memory needed for a relocated real-mode code. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: remove hard-coded assumptions for a specific RM segmentH. Peter Anvin2009-06-073-100/+161
| | | | | | | | | | Remove some hard-coded assumptions about having an RM segment at a specific location. This should allow us to relocate the RM code once the PM code knows where DOS free memory ends. This in turn allows the PM code to load the boot sector almost anywhere it wants to go in low memory, as is required for 100% compliant El Torito support. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: remove the requirement that CS_BASE < 64KH. Peter Anvin2009-06-071-10/+25
| | | | | | | | Remove the requirement that CS_BASE is below 64K, based on its use in the A20 test code. This means it can now be located anywhere in high memory, but it is still a constant. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: move the heap to high memoryH. Peter Anvin2009-06-071-3/+5
| | | | | | | Instead of using a heap arbitrarily allocated in low memory, move it to a chunk of bss in high memory. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: don't hard-code 0:7C00 as the entry pointH. Peter Anvin2009-06-072-4/+10
| | | | | | Make it possible for the setup code to override SS:SP and CS:IP. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* memdisk: pass in the address of the real-mode codeH. Peter Anvin2009-06-073-5/+4
| | | | | | | Pass in the address of the real-mode code instead of hard-coding it in two separate places. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/unzip.cH. Peter Anvin2009-05-291-206/+205
| | | | | | | | | Automatically reformat memdisk/unzip.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/setup.cH. Peter Anvin2009-05-291-869/+883
| | | | | | | | | Automatically reformat memdisk/setup.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/msetup.cH. Peter Anvin2009-05-291-100/+101
| | | | | | | | | Automatically reformat memdisk/msetup.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/memdisk.hH. Peter Anvin2009-05-291-27/+24
| | | | | | | | | Automatically reformat memdisk/memdisk.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/inflate.cH. Peter Anvin2009-05-291-728/+671
| | | | | | | | | Automatically reformat memdisk/inflate.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/e820test.cH. Peter Anvin2009-05-291-43/+43
| | | | | | | | | Automatically reformat memdisk/e820test.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/e820func.cH. Peter Anvin2009-05-291-60/+60
| | | | | | | | | Automatically reformat memdisk/e820func.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/e820.hH. Peter Anvin2009-05-291-3/+3
| | | | | | | | | Automatically reformat memdisk/e820.h using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Run Nindent on memdisk/conio.cH. Peter Anvin2009-05-291-261/+271
| | | | | | | | | Automatically reformat memdisk/conio.c using Nindent. Do this for all files except HDT, gPXE and externally maintained libraries (zlib, tinyjpeg, libpng). Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* Drop support for ACPI 3 E820 extended memory attributesH. Peter Anvin2009-05-216-56/+29
| | | | | | | | | | | | | | Drop all support for ACPI 3 E820 extended memory attributes. There are BIOSes in the field that report completely bogus information here, resulting in no memory at all being detected (we then fall back to E801 detection, but that is problematic in its own ways.) There is strong reasons to believe at this point that the extended memory attributes are not usable in their current form, so drop them and revert back to simple 20-byte support, including for MEMDISK spoofing. Signed-off-by: H. Peter Anvin <hpa@zytor.com>