| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
| |
Add a sector_shift field to the MDI rather than assuming 512-byte
sectors. Fix memdiskfind to report size in bytes, not in sectors.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
| |
Make mstructs.h includable from a Linux utility.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
When mstructs.h is used by MDISKCHK.COM, pointers have
a 16-bit size and thus the mBFT structure sizeof() is
smaller under OpenWatcom. We now union this pointer
member with a uint32_t to force the field to at least
32 bits.
There is another pointer in this header file which is
already unioned with a uint32_t, due to that field's
dual-purpose. That field is fine under OpenWatcom.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
| |
This needs to be in here in order for the header file
to be useful to any C file other than setup.c.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
|
| |
Previously, the patch area began after the beginning of
the MDI, but continued past its end. This is difficult
to express with C structures, so we've simply changed
the patch area to include the entire MDI. So it now
includes the MDI size and MEMDISK version info, which
we simply make constant to avoid modifying.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit moves the MEMDISK header structure into
the common structures header file.
It also adds the "safe hook" structure to the MEMDISK
header structure, since that matches what's in the hook
binaries. Thus, we access the "safe hook" via the
header pointer, instead of separately.
Tested against a DOS floppy image including an
experimental MDISKCHK.COM and also gainst WinVBlock.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
Impact: Initializing variables
The checksum_buf function was providing an incorrect checksum
on at least one build.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| | |
| |
| |
| |
| | |
With this patch, users can now boot El Torito-bootable .ISO (CD/DVD) images.
The user should specify "iso" on the kernel command-line.
|
| | |
| |
| |
| |
| |
| |
| | |
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).
|
| | |
| |
| |
| | |
Suffixed with _512 to indicate a sector size of 512 bytes.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| |
| |
| |
| | |
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.
|
| | |
| |
| |
| | |
New file: bda.h
|
| |/
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
| |
Make it possible for the setup code to override SS:SP and CS:IP.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
| |
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
| |
Print the source of the geometry determination.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
| |
Fix the MBR geometry extraction; there was an off-by-2 error in the
MBR signature offset.
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
|
|
|
|
|
| |
Update copyright notices. Per agreement with my new employer, Intel
Corporation, add Intel copyright notices where appropriate.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
| |
Impact: aestetics
Change "and contributors" to "et al" so that the message actually fits
on one line. This is unfortunate, but what can you do...
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
| |
Clarify that there are nowadays more copyright holders than just
myself.
|
| |\ |
|
| | |
| |
| |
| |
| | |
Move the floppy disk geometry generation code into parallel with the
MBR code, which pretty much mimics the previous behavior.
|
| | |
| |
| |
| |
| |
| |
| |
| | |
We can't rely on the disk type to say if this is FAT vs MBR, since we
haven't determined that yet. Thus, move the FAT test up before the
MBR test; both are heuristic, but the FAT test has much less
probability of false positives, and can be further tightened if
needed.
|
| | |
| |
| |
| |
| |
| | |
If a "large floppy" image is formatted with a FAT filesystem, we can
use the headers in the FAT image to derive the geometry. This is nice
and user-friendly, so do it that way.
|
| | |
| |
| |
| |
| |
| | |
The memdisk install code previously controlled EDD features by controlling
how many INT 13 functions were available. Since we have EDD and non-EDD
versions of the memdisk hooking code now, this is no longer needed.
|
| |/
|
|
|
|
|
|
|
|
|
|
| |
This patch "sets the stage" for the memdisk kernel to include different
"installables": versions of the memdisk hooks.
This patch splits the case of the EDD-compiled hook from the non-EDD-compiled
hook. Both are available inside the kernel, and the kernel chooses which one
to install based on the command-line.
It's possible that other, slightly modified versions of the memdisk hook could
be useful to have...
|
| |
|
|
|
|
| |
Drop a newline we didn't need after all.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
|
|
|
|
|
|
|
|
| |
There is enough evidence that "safeint" is a decent compromise between
The Right Thing[TM] and dealing with the reality of ultra-broken
DOSen. Make it the default.
Clean up some of the command-line parsing code and status printing.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|