| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\ \
| |/
| |
| |
| |
| |
| | |
Resolved Conflicts:
core/cpuinit.inc
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\ \
| |/
| |
| |
| |
| |
| |
| |
| |
| | |
Resolved Conflicts:
com32/modules/Makefile
core/comboot.inc
core/cpuinit.inc
core/idle.inc
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|/
|
|
|
|
| |
DEBUG doesn't work in unzip.c/inflate.c, so always #undef it.
Signed-off-by: H. Peter Anvin <hpa@zytor.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>
|
|
|
|
|
|
| |
() is not a prototype, use (void)
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Impact: Initializing variables
The checksum_buf function was providing an incorrect checksum
on at least one build.
|
|
|
|
|
|
|
| |
Impact: Fixing mBFT alignment
It was previously possible that the mBFT might not be 16-byte
aligned because the .data section was not.
|
|
|
|
|
|
| |
Make the "safe hook" structure code a bit more readable.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| | |
Generate map files to make debugging less painful.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
|
|/
|
|
|
|
|
| |
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>
|
|
|
|
| |
Remove an %ifdef that the macros take care of anyway.
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
We incorrectly used "equ" instead of "dd" (or "db") for strings in
memdisk.inc. Oops! My mistake in my 'freedos' branch. Silly
mistake. - Shao
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
We need memmove.S in the memdisk directory...
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
| |
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/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>
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
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>
|