aboutsummaryrefslogtreecommitdiffstats
path: root/src/biosvar.h
Commit message (Collapse)AuthorAgeFilesLines
* memmap: Introduce SYMBOL() macro to access linker script symbolsKevin O'Connor2015-10-151-3/+3
| | | | | | | 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>
* Fix typos found by codespellStefan Weil2015-10-091-1/+1
| | | | | Signed-off-by: Stefan Weil <sw@weilnetz.de> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Minor - eliminate the SET_GLOBAL macro.Kevin O'Connor2013-10-261-4/+0
| | | | | | | 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>
* Move standard bda type info from biosvar.h to std/bda.h.Kevin O'Connor2013-09-181-157/+4
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Improve accuracy of internal timers.Kevin O'Connor2013-07-201-0/+3
| | | | | | | | | | | | | | | | | 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>
* floppy: Cleanup floppy irq wait handling.Kevin O'Connor2013-03-031-1/+1
| | | | | | | | | | | | | 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>
* Clarify build generated "zone low" values.Kevin O'Connor2013-02-171-3/+3
| | | | | | | | | 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>
* Minor - extend the size of the 'struct bios_data_area_s' to 256 bytes.Kevin O'Connor2012-06-101-0/+3
| | | | | | Make the struct 256 bytes - just for documentation purposes. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Minor - remove CLEARBITS_BDA and SETBITS_BDA macros.Kevin O'Connor2012-06-101-8/+6
| | | | | | | Remove these infrequently used macros and replace with explicit GET_BDA/SET_BDA calls. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Avoid runtime relocation of 16bit "low" mem - calculate at build instead.Kevin O'Connor2012-06-081-2/+2
| | | | | | | | | | | | | 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>
* Convert GET/SET_FLATPTR() accesses to "low mem" to GET/SET_LOWFLAT().Kevin O'Connor2012-05-201-0/+4
| | | | | | | 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>
* EBDA cleanups.Kevin O'Connor2012-05-201-6/+2
| | | | | | | | | 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>
* Convert disk code EBDA variables to VARLOW variables.Kevin O'Connor2012-05-201-42/+1
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Convert USB keyboard code EBDA variables to VARLOW variables.Kevin O'Connor2012-05-201-12/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Convert ps2 code EBDA variables to VARLOW variables.Kevin O'Connor2012-05-201-1/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Convert boot code EBDA variables to VARLOW variables.Kevin O'Connor2012-05-201-2/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Convert timer code EBDA variables to VARLOW variables.Kevin O'Connor2012-05-201-6/+0
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add mechanism to declare variables as "low mem" and use for extra stack.Kevin O'Connor2012-05-201-8/+16
| | | | | | | | | | | | | | | 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>
* Add TSC emulation layer for 386/486 CPUs.Kevin O'Connor2012-02-011-0/+4
| | | | | | | Original patch from Rudolf Marek. Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Add vbe_flag field in BDAJulian Pidancet2011-12-201-1/+2
| | | | Signed-off-by: Julian Pidancet <julian.pidancet@gmail.com>
* Only show bootsplash during boot menu.Kevin O'Connor2010-08-251-1/+0
| | | | | | 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.
* Add FUNC16() helper macro for converting a 16bit func to a segoff_s.Kevin O'Connor2010-07-281-0/+6
|
* Be sure to disable bootsplash on all BIOS boot cases.Kevin O'Connor2010-07-261-1/+2
| | | | | | | | 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.
* Allocate cdemu buffer in low mem instead of ebda.Kevin O'Connor2010-06-061-2/+0
| | | | | | | 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.
* Revert "Rework disabling of ps2 port irqs."Kevin O'Connor2010-03-131-28/+2
| | | | | | | | | 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.
* Dynamically allocate ata_channel info; introduce custom atadrive_s struct.Kevin O'Connor2010-02-281-5/+5
| | | | | | | | | | | 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.
* Dynamically allocate each drive_g with malloc_fseg().Kevin O'Connor2010-02-151-2/+4
| | | | | This eliminates the limit on the number of available drives. It also allows for each driver to allocate additional custom fields.
* Support USB keyboard auto-repeat.Kevin O'Connor2010-02-111-0/+13
| | | | | | 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.
* Rework disabling of ps2 port irqs.Kevin O'Connor2010-01-281-2/+28
| | | | | | 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.
* Be sure to add "void" to all function prototypes that take no args.Kevin O'Connor2010-01-031-3/+3
| | | | Omitting "void" leads to a K&R style declaration which was not intended.
* Add support for 32bit PCI BIOS entry.Kevin O'Connor2009-12-301-2/+21
| | | | | | | | | 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.
* Introduce MODESEGMENT define; rename VISIBLE32 to VISIBLE32FLAT.Kevin O'Connor2009-12-261-3/+3
| | | | | Prepare for support of segmented 32bit code. Add new MODESEGMENT definition, and clarify existing 32bit mode defs.
* Enhance experimental option rom "threading" - enable preemption.Kevin O'Connor2009-12-131-0/+1
| | | | | | | | | | | | | 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 'drive_s' pointer instead of driveid.Kevin O'Connor2009-10-221-8/+13
| | | | | | 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.
* Add support for permanent low memory allocations.Kevin O'Connor2009-09-241-3/+1
| | | | | Support pmm style permanent low-memory allocations. When used, relocate ebda and store permanent memory at top of 640K.
* Define bit names for keyboard shift flags.Kevin O'Connor2009-09-111-1/+1
| | | | Also, move setting of bit flags to the end of process_key().
* Replace common segment/offset pairs with struct segoff_s.Kevin O'Connor2009-09-091-19/+6
| | | | Introduce 'struct segoff_s' to more places.
* Store cdrom emulated driveid directly.Kevin O'Connor2009-08-111-3/+2
|
* Separate ATA code from generic disk code.Kevin O'Connor2009-08-111-1/+1
| | | | | | | | 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 unused cdemu ATA code.Kevin O'Connor2009-08-091-3/+0
| | | | | | 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.
* Implement cdrom disk emulation at high-level instead of in low-level ATA.Kevin O'Connor2009-08-091-10/+16
| | | | | | | | | 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.
* Add Post Memory Manager (PMM) support.Kevin O'Connor2009-08-011-1/+3
| | | | | | | | | | | | 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.
* Unify mode16/32 compiler checks.Kevin O'Connor2009-06-151-6/+2
| | | | | | | 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.
* Verify ebda segment looks sane before using during resume.Kevin O'Connor2009-05-171-0/+6
|
* Minor - add some additional vga definitions of bda.Kevin O'Connor2009-05-061-0/+9
|
* More floppy code cleanups.Kevin O'Connor2009-02-071-2/+1
| | | | Reorganize code slightly to improve readability.
* Implement memcpy_far and checksum_far, and replace _fl variants.Kevin O'Connor2009-01-191-2/+6
| | | | | | The "flat" mode variants work in real mode, but will not work in protected mode. So, replace with versions that take explicit segments.
* Rename MAKE_FARPTR (and similar) to MAKE_FLATPTR.Kevin O'Connor2009-01-191-1/+1
| | | | | | | | 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".
* Minor - streamline SET_GLOBAL macro - reduce #if usage.Kevin O'Connor2009-01-191-9/+5
|
* Move variables from assembler to C code.Kevin O'Connor2009-01-171-4/+4
| | | | | | | | 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.