Michael Brown
a2be828a33
Avoid leaving preloaded_undi with invalid PXENV+/!PXE structure
...
addresses if the signature checks fail.
2007-01-09 02:52:28 +00:00
Michael Brown
697bcc9d24
Since we now always unload the base code stack (even if we keep UNDI),
...
we can never return to the PXE stack and must always use INT 18.
2007-01-09 02:46:58 +00:00
Michael Brown
f2f492a536
If preloaded device matches, use that rather than going via the UNDI
...
loader.
2007-01-09 02:32:06 +00:00
Michael Brown
2436dac281
Populate preloaded_undi device when applicable.
2007-01-09 02:29:54 +00:00
Michael Brown
937289cdc8
Provide storage for an undi_device structure representing the preloaded
...
UNDI stack.
2007-01-09 02:29:18 +00:00
Michael Brown
47222d5ed8
Call PXENV_UNDI_GET_NIC_TYPE to identify NIC physical device.
...
Record all information required for populating a struct undi_device.
Make debugging output more human-readable.
2007-01-09 01:42:28 +00:00
Michael Brown
cea2221737
Use fixed-width fields in struct undi_device, so that pxeprefix.S will be
...
able to populate the structure.
2007-01-09 01:41:26 +00:00
Michael Brown
fbdebac5f4
Copy pxelinux's shutdown sequence: use UNLOAD_STACK without STOP_BASE,
...
and call UNDI_SHUTDOWN first to make sure the NIC is in a safe state.
2007-01-08 05:06:26 +00:00
Michael Brown
8f8af10b22
New strategy: always stop both base code and UNDI. Always free base code
...
memory (unless we get an error while stopping the base code). Leave UNDI
resident (though stopped) for .kpxe.
Still need to add code to record the device identification parameters
prior to stopping UNDI.
2007-01-08 03:48:26 +00:00
Michael Brown
075d79f6d4
Checking in obsolete but working memory-scanning code just for the record
2007-01-08 03:45:00 +00:00
Michael Brown
67e824b539
Neaten up debug messages
2007-01-08 03:42:19 +00:00
Michael Brown
f08093b0d9
Remove spurious debug message
2007-01-08 03:37:32 +00:00
Michael Brown
f0edd11c7d
Now split out into undirom.c and undiload.c
2007-01-08 03:35:51 +00:00
Michael Brown
07e5d4e3dc
Added any-PCI-device UNDI driver
2007-01-08 03:34:47 +00:00
Michael Brown
66f7bcc785
Tidied up debug messages
2007-01-08 03:34:06 +00:00
Michael Brown
a6ba48e51e
Added debugging statements
2007-01-08 03:04:54 +00:00
Michael Brown
239965ff3b
Added missing includes
2007-01-08 03:03:42 +00:00
Michael Brown
6115356859
Added missing declarations
2007-01-08 02:51:27 +00:00
Michael Brown
aff96c13d2
Added missing include
2007-01-08 02:51:04 +00:00
Michael Brown
afc01a1a7f
Split UNDI load/unload out into undiload.c.
2007-01-08 02:48:17 +00:00
Michael Brown
359c888aec
Remove obsolete includes
2007-01-08 02:39:56 +00:00
Michael Brown
6fc75f659b
Separated out UNDI ROM location code into undirom.c, and use struct
...
undi_rom rather than struct pxe_driver. (This is part of the naming
consistency fixes).
2007-01-08 02:38:10 +00:00
Michael Brown
675fe200e5
Use "struct undi_device" instead of "struct pxe_device", and use the
...
function prefix "undinet_" and the variable name "undinic" in undinet.c,
so that we can reserve the variable name "undi" for a struct undi_device.
The idea is that we preserve the Etherboot 5.4 convention that the "UNDI"
code refers to our using an underlying UNDI stack, while the "PXE" code
refers to our providing a PXE API.
2007-01-08 02:24:53 +00:00
Michael Brown
36c1e1aa57
Renamed undi.c to undinet.c. (undi.c will become the UNDI PCI driver)
2007-01-08 02:02:07 +00:00
Michael Brown
234d81728a
Obsolete
2007-01-08 02:00:55 +00:00
Michael Brown
d3558fdd3a
Remove accidentally checked-in code
2007-01-07 19:05:28 +00:00
Michael Brown
85a41b25fe
Move START_UNDI, UNDI_STARTUP, UNDI_INITIALIZE and
...
UNDI_GET_INFORMATION calls into drivers/net/undi.c. undi_probe() now
gets given a pxe_device representing a PXE stack that has been loaded
into memory but not initialised in any way.
2007-01-07 19:02:17 +00:00
Michael Brown
23cb837951
Remember to enable/disable the interrupt at the PIC.
...
Handle failures in undi_open() properly.
2007-01-07 13:31:39 +00:00
Michael Brown
9ab5c0dde7
Remove redundant debug message
2007-01-05 16:15:50 +00:00
Michael Brown
fa9055197d
UNDI loader routine now works
2007-01-05 16:11:05 +00:00
Michael Brown
477a70697a
Added PnP BIOS scanning code, separated out from the UNDI driver
2007-01-05 16:10:03 +00:00
Marty Connor
7dee2556f4
Fixed typo
2007-01-05 16:09:47 +00:00
Michael Brown
9780fef360
Partial implementation of UNDI loader caller.
2007-01-05 03:24:39 +00:00
Michael Brown
0638945c7e
Add PXE driver-scanning code, capable of locating all PXE ROMs in a system
...
and matching them up to (e.g. PCI) devices.
2007-01-05 01:52:06 +00:00
Michael Brown
ef50ea0b2b
Renamed undi_net.c to undi.c.
2007-01-04 19:43:35 +00:00
Michael Brown
6cf488dcf7
Obsolete; net driver functionality is now in undi_net.c and bus driver
...
functionality is now in pxebus.c. (Not all bus functionality is ported
across yet.)
2007-01-04 19:42:05 +00:00
Michael Brown
7e07dfb2f4
Added PXE bus driver (with support only for using PXE structures found
...
lying about in memory, not for loading from ROM), and UNDI net driver.
2007-01-04 19:38:34 +00:00
Michael Brown
e28db95de6
Obsolete
2007-01-04 19:37:31 +00:00
Michael Brown
70acce06e4
This file is no longer used
2007-01-04 19:36:31 +00:00
Michael Brown
b12cd68726
Ripped out everything except the ability to send EOI to the PIC.
2007-01-04 19:36:18 +00:00
Michael Brown
de2fc50f4c
Add as a separate file so that we can do "make bin/xxxx.kpxe" rather than
...
having to edit PXELOADER_KEEP_ALL as a config option.
2007-01-04 19:35:10 +00:00
Michael Brown
290c5ee779
Don't automatically call gateA20_set() when returning from a real-mode
...
call.
2007-01-04 04:32:18 +00:00
Michael Brown
f58f193633
Engage brain: since when was zero >= 0x80 ?
2006-12-21 05:15:26 +00:00
Michael Brown
9c3b4e5b0b
Some BIOSes return 0xe0 for extended characters. Just assume that
...
anything over 0x80 is an extended character.
2006-12-21 00:07:48 +00:00
Michael Brown
dbb7b30cca
Return ANSI sequences for special keys
2006-12-20 23:42:28 +00:00
Michael Brown
43d976edd0
Prevent NULL from ever pointing to some real code or data. (This was
...
causing the serial console to ignore input, because it happened to end up
linked with serial_ischar() at address 0, which core/console.c decided was
invalid).
2006-12-20 20:28:20 +00:00
Michael Brown
0aa1223264
Optimise bios_putchar for speed(!) by avoiding two separate real-mode
...
calls. This does make a visible difference when clearing the screen with
werase() inside bochs or qemu.
2006-12-19 01:15:05 +00:00
Michael Brown
8b3a4c9862
Add basic ANSI escape sequence support to BIOS console
2006-12-18 01:19:38 +00:00
Michael Brown
8a45f619a9
Fix building on gas versions that don't auto-insert addr32 prefixes
2006-12-12 19:07:18 +00:00
Michael Brown
8bff0f0619
Avoid draining the keyboard buffer during gateA20_set(). It shouldn't
...
technically be necessary, because the "enable A20" command requires
only that the keyboard controller is ready to accept input (i.e. that
its input buffer is empty), and shouldn't also require that the
keyboard is ready to send output (i.e. that its output buffer is also
empty). See http://www.smsc.com/main/tools/io-bios/42i.pdf section
3.1 ("Command Invocation") for a justification.
gateA20_set() is called on every real-mode transition (in case some
idiot piece of external code such as Intel's PXE stack decided it
would be fun to re-disable A20), so draining the keyboard buffer means
that we end up losing keypresses on some systems. In particular, this
makes typing at the command line almost impossible, and causes
Etherboot to ignore Ctrl-Alt-Del.
We should really implement a gateA20_test() function to verify that
gate A20 has been correctly enabled, and think about adding other
commonly-used methods such as Fast Gate A20.
2006-12-05 09:45:39 +00:00
Michael Brown
88e38fa148
We don't actually have a stdio.h header file. Our printf() functions are
...
defined in vsprintf.h. (This may change, since vsprintf.h is a
non-standard name, but for now it's the one to use.)
There should be no need to include vsprintf.h just for DBG() statements,
since include/compiler.h forces it in for a debug build anyway.
2006-09-27 10:58:14 +00:00
Marty Connor
6ac78f6aff
added stdio.h to includes for DBG compilation
2006-09-27 05:57:06 +00:00
Marty Connor
c4964c3e3a
fix args to _disable routine
2006-09-19 15:01:16 +00:00
Marty Connor
56a3ff7202
get rid of compile warnings (except intentionally generated ones)
2006-09-14 20:54:05 +00:00
Marty Connor
c30623b739
fix DBG macro unknown variable
2006-09-14 20:34:53 +00:00
Michael Brown
0566ab2a2f
Added geometry-guessing code based on the partition table
2006-09-08 22:22:03 +00:00
Michael Brown
78dd963c1f
Check to see if we've reached the end of the map before attempting to
...
skip past an empty region, otherwise we end up generating an infinitely
long e820 map. (Yes, there *are* real systems that provide e820 maps
with a zero-length region at the end...)
2006-08-31 13:25:45 +00:00
Michael Brown
5a54225aef
Added support for INT 13,15; NTLDR calls it (though it may not
...
actually do anything with the result, since it carried on using us
even when we returned failure).
2006-08-27 01:22:01 +00:00
Michael Brown
40724431e8
Added support for INT 13,15; NTLDR calls it (though it may not
...
actually do anything with the result, since it carried on using us
even when we returned failure).
2006-08-26 23:42:02 +00:00
Michael Brown
19883779ba
Use TEXT16_CODE() rather than manually specifying ".code16" etc, since
...
our manual ".code32" will break a KEEP_IT_REAL build.
2006-08-24 18:43:28 +00:00
Michael Brown
6abfaa153b
Towards making KEEP_IT_REAL work again.
...
Fix bug that caused over-allocation of .text16 and .data16 memory areas
by a factor of 16.
2006-08-24 13:18:05 +00:00
Michael Brown
4afc494b83
Both the !PXE and PXENV+ structures must be paragraph-aligned
2006-08-09 18:22:25 +00:00
Michael Brown
fd07f56f0d
Note to self: learn to count.
2006-08-09 00:56:07 +00:00
Michael Brown
843bcc291d
Added missing __from_text16()s when passing pointers to PXE NBP.
2006-08-09 00:39:21 +00:00
Michael Brown
751ae718bd
pxe_int_1a is needed by pxe_call.c
2006-08-09 00:16:57 +00:00
Michael Brown
18c112d205
Added (not yet tested) PXE API entry point and support functions.
2006-08-08 20:43:33 +00:00
Michael Brown
a0a872f7f1
Updated PXE UDP implementation to use the new Etherboot UDP API.
...
Updated PXE API dispatcher to use copy_{to,from}_user, and moved to
arch/i386 since the implementation is quite architecture-dependent.
(The individual PXE API calls can be largely
architecture-independent.)
2006-08-02 23:08:10 +00:00
Michael Brown
2138db36ca
Add "addr32" required explicitly by older gas.
2006-06-12 01:07:43 +00:00
Michael Brown
df4b503a8c
Added null trap code for debugging. (Must be included by adding
...
--nulltrap to the make target at the moment.)
2006-06-11 01:48:29 +00:00
Michael Brown
476d02051f
Windows Server 2003 sulks if we feed it an empty region in base memory
...
as a result of our memory map editing, so strip out any empty regions.
2006-06-09 12:20:03 +00:00
Michael Brown
6fd1bd0510
Added missing check-in
2006-06-09 10:19:17 +00:00
Michael Brown
17eea9f933
Fix bug with >256 cylinders.
...
Allow our functions to return a non-zero, non-error status (since the
INT 13 Extensions Check has to return the API version in the register
that is otherwise always used for the error code).
Report a non-zero API version from the INT 13 Extensions Check; GRUB
now uses extended reads.
2006-06-08 19:28:08 +00:00
Michael Brown
fdf62528ca
It's astonishing how long really fundamental bugs can survive without
...
being noticed...
2006-06-08 15:06:09 +00:00
Michael Brown
191a906338
Fix some remarkably obvious mistakes in pcidirect.h
2006-06-08 14:57:04 +00:00
Michael Brown
763b7e2ef9
We now have just romprefix, rather than having isaprefix and pciprefix
2006-06-06 15:41:21 +00:00
Michael Brown
ef37f78cbe
Cut out almost all the optional code paths, drastically simplifying the
...
flow of control through this code.
We now always add PCI and PnP headers even for ISA ROMs; there's no harm
in doing so.
UNDI loader is still missing.
2006-06-06 15:33:39 +00:00
Michael Brown
e7eca7b7cb
Code segment may not be writable; create the temporary pointer to the GDT
...
on the stack.
2006-06-06 15:30:28 +00:00
Michael Brown
46253ba618
Calculate _rom_size for the ROM prefix
2006-06-06 15:29:39 +00:00
Michael Brown
35b04b1514
Tidy up comment
2006-05-28 14:40:04 +00:00
Michael Brown
041a04335e
Fixed assembly on old versions of gas
2006-05-28 14:21:29 +00:00
Michael Brown
9f86754f90
Updated to work with libprefix.
2006-05-25 22:04:47 +00:00
Michael Brown
29340d7728
Documented the fact that the prefix can prot_call(main) without
...
worrying about its stack being destroyed during the Etherboot run.
2006-05-25 22:04:17 +00:00
Michael Brown
d82f71efd0
Also hide base memory region from E820 map.
2006-05-25 00:10:58 +00:00
Michael Brown
89da833c5d
init_librm() and prot_call() are now real-mode far calls.
...
install() now calls relocate(), moves the protected-mode code to the new
location, and calls hide_etherboot().
2006-05-25 00:06:45 +00:00
Michael Brown
4d81b48504
Has been obsolete for a while.
2006-05-25 00:04:37 +00:00
Michael Brown
1966945a5d
Update relocate() to work with get_memmap().
...
Change semantics; relocate() now just finds a suitable location; it
doesn't actually perform the relocation itself. Code in libprefix does
the copy in flat real mode.
2006-05-25 00:04:13 +00:00
Michael Brown
f939ff7cb5
Fix printf format warning error
2006-05-25 00:02:27 +00:00
Michael Brown
3bd3c13c7b
Why should pushal/popal put the registers on the stack in a logical
...
order?
2006-05-25 00:01:46 +00:00
Michael Brown
dd75965057
Typo.
2006-05-25 00:00:53 +00:00
Michael Brown
e4f8d6eed7
Add a "count" field to struct memory_map.
2006-05-25 00:00:30 +00:00
Michael Brown
986f6ffff1
Define a struct memory_map with a fixed number of entries, rather than
...
requiring each caller to decide how many entries it wants to permit.
2006-05-24 14:41:27 +00:00
Michael Brown
edcf89e2b0
Remove the automatic segment register save and restore; most users of
...
REAL_CODE() don't need it.
2006-05-24 14:11:36 +00:00
Michael Brown
02cf755f3f
Removed REAL_EXEC(); there is no longer any code using it.
2006-05-24 14:10:15 +00:00
Michael Brown
103aff3ae2
Added potentially required "\n\t" on the end of asm_code_str
2006-05-24 14:06:28 +00:00
Michael Brown
190276a8b6
NBI is due for removal
2006-05-24 13:53:35 +00:00
Michael Brown
52125e158c
Will be replaced with a block-device implementation.
2006-05-24 13:52:46 +00:00
Michael Brown
8110f9b082
Updated to REAL_CODE()
2006-05-24 13:50:40 +00:00
Michael Brown
595f161b51
Updated to REAL_CODE().
...
int13_boot() now does its own segment register save and restore, ready
for the removal of segment register restoration from the libkir
generic code.
2006-05-24 13:48:16 +00:00
Michael Brown
e8550035af
Updated to REAL_CODE()
2006-05-24 13:28:39 +00:00
Michael Brown
c4d688c005
Updated to REAL_CODE().
2006-05-24 13:24:22 +00:00