summaryrefslogtreecommitdiff
path: root/memdisk
Commit message (Collapse)AuthorAgeFilesLines
...
| * memdisk: Use real_addr_t for SEG:OFF fieldsShao Miller2010-06-112-28/+41
| | | | | | | | | | | | | | | | | | | | | | | | We used uint32_t in a few places where it's also handy to refer to those fields' segment and offset components. Now we can do so via the real_addr_t union type. Additionally, there are a couple of places where we now have pointer fields instead of uint32_t fields, because we know what kind of struct the field is pointing to. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
| * memdisk: Move common structures into headersShao Miller2010-06-115-104/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | Since MDISKCHK.COM (and possibly COM32 modules) could make use of structures found in MEMDISK's setup.c, we move these into a new header file mstructs.h. Also, since the OpenWatcom compiler uses a structure packing prefix and GCC uses a structure packing postfix, we accomodate this with preprocessor definitions around those structures needing to be packed. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
* | Merge commit 'syslinux-3.86' into pathbasedsyslinux-4.00-pre38H. Peter Anvin2010-04-011-14/+15
|\ \ | |/ | | | | | | | | | | Resolved Conflicts: core/cpuinit.inc Signed-off-by: H. Peter Anvin <hpa@zytor.com>
| * memdisk: Calculate mBFT checksum laterShao Miller2010-03-301-14/+15
| | | | | | | | | | | | | | We were calculating the mBFT checksum too early; dpt_ptr could change after checksumming, so we now do it after that possibility. Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
* | Merge branch 'master' into pathbasedH. Peter Anvin2010-03-301-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | Resolved Conflicts: com32/modules/Makefile core/comboot.inc core/cpuinit.inc core/idle.inc Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
| * memdisk: MBR not recognized correctlyBodo Stroesser2010-03-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a small inaccuracy in memdisk: get_disk_image_geometry() does not use MBR data to detect disk geometry, since it checks MBR signature at wrong offset. This normally does not cause problems, because memdisk guesses a reasonable value, if no MBR is found. Signed-off-by: Bodo Stroesser <bstroesser at ts.fujitsu.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
* | memdisk: drop DEBUG from unzip.cH. Peter Anvin2010-02-281-0/+2
|/ | | | | | DEBUG doesn't work in unzip.c/inflate.c, so always #undef it. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
* 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>