| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
Use a macro to define and obtain the value of a symbol introduced by
the linker scripts (scripts/layoutrom.py).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
| |
Signed-off-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Remove the SET_GLOBAL macro - it is no longer used and since it was
only available in "32bit flat" mode it does not have much use.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The TICKS_PER_DAY setting is a bios standard and needs to be 1573040
for compatibility. However, there are actually ~1573042.24 ticks in a
day. So, only use TICKS_PER_DAY when working with the BDA
timer_counter - not when calculating any internal times.
The PIT hz is actually 143181800 / 12 (~1193181.667). This can be
accurately encoded as PMTIMER hz / 3. Because the PIT hz is usually
multiplied and divided by other numbers, we can use the PMTIMER hz and
defer the division by 3 to improve accuracy.
When doing division for delay time calculations, always round up the
division so the delay is never less than the requested time.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename FRS_TIMEOUT to FRS_IRQ - the flag indicates that an irq has
been received - it isn't directly related to timeouts.
On a timeout event, disable the floppy controller instead of doing a
full reset. Also, perform the disable directly in floppy_wait_irq().
Always wait for the floppy irq after enabling the controller and after
a recalibrate command.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Rename datalow_base (and similar) to zonelow_base, and datalow_start
(and similar) to varlow_start. This helps distinguish between the
bounds for the runtime dynamic memory pool and the compile time global
variables.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
| |
Make the struct 256 bytes - just for documentation purposes.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Remove these infrequently used macros and replace with explicit
GET_BDA/SET_BDA calls.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Some 16bit accesses to "low" mem variables use 16bit relocations
instead of the normal 32bit relocations. This causes build problems
if the "low" mem sections move more than 64K during relocation.
The final location of the "low" memory can be determined during the
build, so link the 16bit code with the final post-reloc location of
the "low" mem variables instead. This eliminates the need to do these
runtime relocations on the 16bit code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Add new GET/SET_LOWFLAT() macros and convert appropriate users to
them. The new macros make for slightly better code generation.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
| |
Clean up includes of biosvar.h.
Rename GET/SET_EBDA2 to GET/SET_EBDA - nearly all users use the
extended form now anyway.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a mechanism (VARLOW declaration) to make a variable reside in the
low memory (e-segment) area. This is useful for runtime variables
that need to be accessed from 16bit code and need to be modifiable
during runtime.
Move the 16bit "extra stack" from the EBDA to the low memory area
using this declaration mechanism. Also increase the size of this
stack from 512 bytes to 2048 bytes.
This also reworks tools/layoutrom.py a bit.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
|
|
|
| |
Original patch from Rudolf Marek.
Signed-off-by: Rudolf Marek <r.marek@assembler.cz>
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
|
|
|
|
| |
Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
|
|
|
|
|
|
| |
When the bootsplash picture is shown, it's not possible to see text.
So, only display the picture while prompting the user for the boot
menu.
|
| |
|
|
|
|
|
|
|
|
| |
Disable the bootsplash on cbfs payload exec, and if something hooks
int19.
Also, be sure to only disable the bootsplash (revert to text mode)
once.
|
|
|
|
|
|
|
| |
Using the low memory buffer gives more flexibility with the final
location of the buffer.
Don't allocate the buffer at all if no cdrom drives are present.
|
|
|
|
|
|
|
|
|
| |
This reverts commit 6f702dd6987b22e9bce472fe61910392af17416a.
That patch introduced a regression by enabling mouse interrupts by
default. It also appears that disabling interrupts by software alone
will not work well with some old DOS programs that hook the keyboard
irq.
|
|
|
|
|
|
|
|
|
|
|
| |
Don't limit the number of ATA controllers supported - just dynamically
allocate the structs.
Create an atadrive_s struct that extends the standard 'struct drive_s'
and have the new struct store a pointer to the ata channel info.
Also, prefer storing drive_s pointers as 32bit "flat" pointers -
adjust them as needed in the 16bit code.
|
|
|
|
|
| |
This eliminates the limit on the number of available drives. It also
allows for each driver to allocate additional custom fields.
|
|
|
|
|
|
| |
Support handling of multiple keys pressed simultanously.
Support auto-repeat via USB HID Set_Idle command.
Also, add "noinline" directives to reduce stack usage of timer irq.
|
|
|
|
|
|
| |
Disable the ps2 port irqs in software instead of hardware. This
prevents a race where an irq could get queued and later called when
not desired.
|
|
|
|
| |
Omitting "void" leads to a K&R style declaration which was not intended.
|
|
|
|
|
|
|
|
|
| |
Create a new code blob (code32seg) with support for 32bit functions
that need to utilize explicit segment accesses.
This code blob uses global variables relative to %gs and with a
dynamic code offset (determined by get_global_offset()).
Add BIOS32 structure and code.
Add code for 32bit PCI BIOS code.
|
|
|
|
|
| |
Prepare for support of segmented 32bit code.
Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When experimental support for parallelizing option roms and hardware
init (default disabled) is selected, add support for checking on
hardware init progress from the RTC irq handler.
Enable ability for RTC to be turned on for additional users.
Allow regular option roms (not just vga option roms) to run in
parallel with hardware init.
Don't use stack in transition32 / transition16 until new mode is
entered.
Also, cleanup leaking of data handlers in usb code.
Also, decrease frequency of iomemcpy checks (every 2K instead of 1K).
|
|
|
|
|
|
| |
Pass a pointer to the drive_s struct instead of a driveid array offset.
Don't allocate ata drive's until a real drive found.
Introduce getDrive() and allocDrive() functions.
|
|
|
|
|
| |
Support pmm style permanent low-memory allocations.
When used, relocate ebda and store permanent memory at top of 640K.
|
|
|
|
| |
Also, move setting of bit flags to the end of process_key().
|
|
|
|
| |
Introduce 'struct segoff_s' to more places.
|
| |
|
|
|
|
|
|
|
|
| |
Move generic code from ata.c to new file block.c.
Rename atabits.h to ata.h and move ata header definitions from disk.h.
Rename ATA.channels to ATA_channels.
Rename ATA structure to Drives.
Support both CONFIG_DRIVES and CONFIG_ATA options.
|
|
|
|
|
|
| |
Remove the low-level ATA code for short reads on cdroms now that cd
emulation is done at higher-level.
Also, remove sector_count from ebda - ata code updates op->count now.
|
|
|
|
|
|
|
|
|
| |
Add a 2K buffer to the ebda to allow for cdrom 512 byte vs 2048 byte
sector emulation.
For unaliagned cdemu reads, just make multiple cdrom reads instead of
using ata specific code for short reads.
Also, define cdemu virtual sectors using struct chs_s, and update
legacy_lba() func to take pointer to a chs_s struct.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Complete the initial implementation of PMM.
Default new PMM code to be enabled.
Move malloc code from memmap.c to pmm.c.
Define new malloc zones for PMM (ZoneTmpLow and ZoneTmpHigh).
Change default READ/WRITE_SEG macros to use 32bit pointers (the 16bit
PMM code use "big real" mode and requires 32bit accesses).
Allow pmm allocations to occur during bcv executions also.
Add low-memory clearing before boot.
Also, align the default f-seg memory.
|
|
|
|
|
|
|
| |
Add ASSERT16/ASSERT32 macros to farptr.h.
Use those macros in place of open-coded checks.
Add "noreturn" attribute to functions to reduce compiler warnings.
Add ASSERT32 to smp_probe() to eliminate 16bit assembler warnings.
|
| |
|
| |
|
|
|
|
| |
Reorganize code slightly to improve readability.
|
|
|
|
|
|
| |
The "flat" mode variants work in real mode, but will not work in
protected mode. So, replace with versions that take explicit
segments.
|
|
|
|
|
|
|
|
| |
The term "far pointer" is used in many 16bit specs, and it is
different from what MAKE_FARPTR creates. So, use the term "flat
pointer" in the code to distinguish between the two meanings.
Also, use the suffix "_fl" consistently when working with "flat
pointers".
|
| |
|
|
|
|
|
|
|
|
| |
Define macro VAR16FIXED for declaring a variable at a fixed location.
Introduce new file src/misc.c, and move non int15 calls from system.c
to it.
Implement all fixed location variables in C code.
Move IDT/GDT defs to misc.c. Remove unused gdt entry 1.
|