david/ipxe
david
/
ipxe
Archived
1
0
Fork 0
Commit Graph

1089 Commits

Author SHA1 Message Date
Michael Brown b8d619e822 Added macros for generating static DHCP options 2006-07-19 16:16:51 +00:00
Michael Brown 254fe6e00e Split DHCP packet creation into two parts: creating the basic packet
structure, and populating it with options.  This should allow us to
use the same basic options list for both DHCPDISCOVER and DHCPREQUEST,
plus making it much easier to set the non-constant parameters
(e.g. requested IP address) in request packets.
2006-07-19 12:12:45 +00:00
Michael Brown e40ebb67de Allow for calling find_dhcp_option() with "options" set to NULL, in order
to search through all registered option blocks.

Move some static inlines that are likely to be used frequently into
dhcpopts.c as normal functions, to save space.
2006-07-19 11:05:38 +00:00
Michael Brown 7ab29b0bfe This file breaks "make blib"; please find a way to avoid doing this. 2006-07-17 19:19:17 +00:00
Derek Pryor e71098a652 The first packet (ClientHello Handshake) can be constructed and is accepted
by SSL servers. Framework.c allows me to test the library against a given
https server.
2006-07-17 16:38:20 +00:00
Michael Brown 6c01d3bb95 Fix creation of the htype field; the ll_proto field from which it is
derived is a 16-bit big-endian field, but htype is only 8 bits wide.
2006-07-17 13:07:14 +00:00
Michael Brown 35b0233baa Tidy up hex_dump() output. 2006-07-17 13:04:29 +00:00
Michael Brown b24947f0c0 Add sketch code to reassemble a DHCP packet from our internal "everything
is a DHCP option" data structures.

We need this code in order to be able to return a DHCP packet to a PXE NBP
which reflects options from our multiple sources (e.g. NVS and DHCP
server).  This is expensive, but necessary.  Having paid this cost, we may
as well try to use the same code to generate our DHCP request packets,
since the process is similar.
2006-07-17 12:47:22 +00:00
Michael Brown 12da7ea475 Add (untested) code for parsing a received DHCP packet and constructing a
DHCP options block from the contents.
2006-07-15 19:24:55 +00:00
Michael Brown 19e8b41562 Add code to modify DHCP option values within a block. 2006-07-13 20:49:04 +00:00
Michael Brown 3acbff4f00 How did this ever work properly before? 2006-07-13 18:27:23 +00:00
Derek Pryor 47be47bf17 Adding SSL Constructs header file. (First version) 2006-07-10 13:26:20 +00:00
Nikhil Chandru Rao 5f651f8622 Added fragment reassembly code 2006-06-30 08:52:03 +00:00
Marty Connor eb091f03e3 fix printf format args 2006-06-29 19:04:25 +00:00
Marty Connor e8cc1c4333 Removed vestigal FILO code 2006-06-29 18:07:02 +00:00
Marty Connor 623f2e7b9d Added bin/.blib.list to VERYCLEANUP so .bin directory is made empty 2006-06-29 17:58:48 +00:00
Nikhil Chandru Rao 8de630c62b Removing net/interface.c and include/gpxe/interface.h 2006-06-29 06:51:11 +00:00
Michael Brown 51d62d1a3c Provide a mechanism for returning the encapsulator as well as the
encapsulated option; this will be needed for modifications to the options
block.
2006-06-28 18:59:54 +00:00
Nikhil Chandru Rao c9ea710930 Renamed net/interface.c and include/gpxe/interface.h to net/tcpip_if.c and include/gpxe/tcpip_if.h respectively. Made changes in the other files. 2006-06-28 15:43:08 +00:00
Michael Brown 291f072b82 Add priority mechanism 2006-06-28 13:48:02 +00:00
Michael Brown bd0c8b21ad Change dhcp_num_option() to return the numerical value directly. 2006-06-28 12:16:41 +00:00
Dan Lynch d8b51332c6 typo in macro fixed 2006-06-28 11:53:41 +00:00
Dan Lynch ba2bfd54ed - modified length of password string to match visible field length
- value of n passed to wgetnstr should now be equivalent to output from strlen (i.e. length excluding NUL-terminating character)
2006-06-28 11:52:30 +00:00
Dan Lynch f9887c3f0f started on ANSI sequence processing 2006-06-28 11:50:02 +00:00
Dan Lynch c29c868475 - implemented cursor retreat function (_wcursback) as a core function
- reimplemented cleaner wgetnstr
- fixed wdelch for use with _wcursback
2006-06-28 11:48:40 +00:00
Nikhil Chandru Rao 6e2c97b0c0 Added ipv4_pseudo_header structure 2006-06-28 09:59:27 +00:00
Nikhil Chandru Rao e60817fa7a IP6 specifications 2006-06-28 09:44:41 +00:00
Nikhil Chandru Rao 41b399d672 Fixed endianness of 16- and 32- bit values 2006-06-28 09:10:35 +00:00
Nikhil Chandru Rao a6c6b3d739 Fixed whitespaces; updated UDP code 2006-06-28 07:46:28 +00:00
Dan Lynch 2b15084388 - first check-in for mucurses_test.c
- added mucurses_test.c build targets
2006-06-27 17:31:01 +00:00
Michael Brown 0bcaa8a21f First stab at DHCP option handling in a way that will allow us to have
multiple option sources (e.g. multiple DHCP replies, non-volatile
storage etc.)
2006-06-27 17:24:07 +00:00
Dan Lynch 7f4cfe4a84 - put in the screen initialisation stuff and clear the screen... 2006-06-27 17:18:11 +00:00
Dan Lynch 11e280670d - works with test ansi tty, but will need a rethink when we start
getting key_ codes instead
2006-06-27 17:15:34 +00:00
Dan Lynch f78fa3c59d - working basic ansi termnal extension for mucurses 2006-06-27 17:11:57 +00:00
Dan Lynch 916f21921f check whether malloc returns a valid pointer 2006-06-27 13:32:15 +00:00
Dan Lynch 9ca2f64ee1 moved console specific items out of mucurses (should be handled by external screen object) 2006-06-27 13:31:30 +00:00
Dan Lynch 197c0c91b2 make path relative (so that I don't break eb top of tree !) 2006-06-27 13:28:43 +00:00
Dan Lynch 05c0b3ce09 included contents of input.{c,h} in kb.c 2006-06-27 13:27:28 +00:00
Dan Lynch 04fcee2306 enabled build entry for mucurses libraries 2006-06-27 11:40:04 +00:00
Dan Lynch 446c1a3372 - deprecated in favour of a split library model 2006-06-27 11:05:13 +00:00
Dan Lynch 6d34baaef9 - testable console framework implementing mucurses SCREEN struct 2006-06-27 11:00:14 +00:00
Dan Lynch e442447f37 - multiple static inline definitions added
- changes made to some constants and macros
- changes made to _curses_screen struct
- identified and removed prototypes for yet more unsupportable functions
2006-06-27 10:38:57 +00:00
Dan Lynch 5d2f39bbc2 added placeholder SRCDIRS entry for mucurses 2006-06-27 10:31:42 +00:00
Dan Lynch 1c87d54bb8 - recoded wgetch and wgetnstr for greater more efficiency
- wgetch now includes non, part and full blocking read support
2006-06-27 10:24:40 +00:00
Michael Brown 35557914e3 Simplify ipv4_tx() by not having a separate "source" variable now that
we are constructing the IP header ourselves.

Formatting fix-ups (80 column limit is mandatory!)
2006-06-26 16:10:34 +00:00
Michael Brown b49de73950 Factorise out common code 2006-06-26 16:01:24 +00:00
Michael Brown e517a4771b Split ipv6 functions out from ipv4.c 2006-06-26 15:33:46 +00:00
Michael Brown e04ea505c9 Whitespace fixes 2006-06-26 13:45:24 +00:00
Dan Lynch fb85954249 first working version - nasty, but mostly works 2006-06-26 08:24:34 +00:00
Nikhil Chandru Rao f5ebf067c4 added generalized sockaddr structure and ip6 sockaddr 2006-06-25 05:18:24 +00:00
Nikhil Chandru Rao 90fbff8f34 added support for processing and transmitting without uIP 2006-06-25 05:16:54 +00:00
Nikhil Chandru Rao 74339b3c6e updated UDP interface 2006-06-25 05:13:17 +00:00
Nikhil Chandru Rao fdc05e2664 created interface for transport-network interface 2006-06-25 05:12:07 +00:00
Derek Pryor 8b0cac40ca Added gpxe-0.5/src/crypto/ for the SSL Library 2006-06-22 17:15:45 +00:00
Dan Lynch 890dc758e8 - proper layout formatted soft label array, with justification formatted labels
- some minor preventatives
2006-06-21 15:09:55 +00:00
Dan Lynch 811df504a5 - erradicate compiler warning due to possibility of uninitialised variables (switch statement) 2006-06-21 10:38:03 +00:00
Dan Lynch 6fc723c294 - added doxygen @file header
- no longer depends on slk
2006-06-21 10:35:46 +00:00
Dan Lynch d77120541a - added doxygen @file header 2006-06-21 10:31:59 +00:00
Dan Lynch 172a568af5 - added doxygen @file header
- some more minor functionality implemented
2006-06-21 10:31:20 +00:00
Dan Lynch 3049a1f026 added doxygen @file header 2006-06-21 10:30:03 +00:00
Dan Lynch 14f5d3203d - removed slk references
- corrected minor algo errors in primitives
- added doxygen @file header
2006-06-21 10:29:13 +00:00
Dan Lynch 79a9aced26 - added doxygen @file header
- wdeleteln function implemented
2006-06-21 10:27:52 +00:00
Dan Lynch 12ca5aa442 added doxygen file header 2006-06-21 10:26:01 +00:00
Dan Lynch 1632c25c78 - major implementation work completed (testing in progress)
- some optimisation done
2006-06-21 10:21:40 +00:00
Dan Lynch 3994688804 initial check in 2006-06-21 10:20:39 +00:00
Michael Brown 3a660f9b25 Update ftp.c and hello.c to use the generic async_operations API. 2006-06-19 15:46:58 +00:00
Michael Brown 15397db2b4 Placeholder 2006-06-17 23:34:48 +00:00
Michael Brown 8637834031 Made the temporary buffer part of the TCP senddata() API, to ease the
transition away from uIP.

Prepared ipv4.c for transition away from uIP.
2006-06-17 23:20:54 +00:00
Michael Brown 3c8aafa209 Simplify RX data path.
Kill off the static single net device and move to proper dynamic
registration (which we need with the new device model).

Break the (flawed) assumption that all network-layer protocols can use
ARP; such network-layer protocols (i.e. IPv4) must now register as an ARP
protocol using ARP_NET_PROTOCOL() and provide a single method for checking
the existence of a local network-layer address.
2006-06-17 22:36:27 +00:00
Michael Brown 8aeead7c1c Remove dependency on arptable[] (which is no longer used). 2006-06-16 14:48:31 +00:00
Michael Brown d393e61d8a Temporary hack to work around the "TX overflow" problem in the interim
period before updating to the new driver API (which can cope with
having TX packets in progress).
2006-06-16 14:38:16 +00:00
Michael Brown 52de4935f9 Add 4 bytes to maximum frame length to allow for the frame checksum.
(This actually matters once you try using TCP, because you *will*
receive full-sized frames.)
2006-06-16 14:30:41 +00:00
Michael Brown 7c76791730 Improve debugging output for legacy wrapper 2006-06-16 14:27:04 +00:00
Michael Brown e5865e796b Forward-port event queue fixes from 5.4 tree. 2006-06-16 14:05:43 +00:00
Michael Brown a20c565ef3 Forward-port start-of-day fixes from 5.4 tree 2006-06-16 14:03:43 +00:00
Michael Brown 50ab8c0e5b Forward-port reset-related changes from 5.4 tree. 2006-06-16 14:00:43 +00:00
Michael Brown 968501e323 For consistency 2006-06-16 13:17:40 +00:00
Michael Brown bcdcd796fb 32kB window is actually larger than our typical receive ring size.
Shrink to 4kB for now.  We might want to see if it can be made
genuinely indicative of the RX ring size in the new TCP
implementation.
2006-06-16 13:16:59 +00:00
Michael Brown bbd9e28061 Simplify TX datapath. 2006-06-16 00:19:46 +00:00
Michael Brown cce2e47ff4 Added iSCSI boot test code 2006-06-14 17:00:25 +00:00
Michael Brown 3b51c719d3 Generalise three-wire interface to generic SPI interface.
Update rtl8139 driver to instantiate an SPI interface with a three-wire
device attached.
2006-06-14 00:22:50 +00:00
Michael Brown ab4f96e525 Move per-transition delays from generic bit-bashing layer to i2c layer
(since SPI bit-bashing will require different delay semantics).
2006-06-14 00:20:35 +00:00
Michael Brown 714641ae6d Translate between "0 = success" and "0 = failure" call standards. 2006-06-14 00:18:13 +00:00
Michael Brown 51a36f1cfb Change read_bit() to return 0 or -1UL, rather than 0 or 1. 2006-06-12 19:29:50 +00:00
Michael Brown 2e49441535 Updated debug message to reflect change in data structure. 2006-06-12 01:10:08 +00:00
Michael Brown 2138db36ca Add "addr32" required explicitly by older gas. 2006-06-12 01:07:43 +00:00
Michael Brown c10698b8b4 Add NULL_TRAP as a config option 2006-06-11 01:55:43 +00:00
Michael Brown 55bb40c39a Fix typo 2006-06-11 01:55:12 +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 7ce44f7480 Update to use the generic i2c bit-bashing code. 2006-06-11 00:57:38 +00:00
Michael Brown 3ed40686c9 Added bit-bashing i2c interface code 2006-06-11 00:57:00 +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 e90b64d625 Added sketch of bit-bashing interface common code 2006-06-08 19:47:09 +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
Dan Lynch ad1aca0634 - separated curses.c out into separate source files to optimise
library use later on
- some small mods to existing functions
2006-06-08 17:23:37 +00:00
Michael Brown 1697c78848 Legacy drivers cannot cope with multiple active devices. 2006-06-08 15:18:27 +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 8d0c5f3302 Use byte 6 for the checksum, rather than byte 5. (Byte 5 may be part of
the jmp instruction).
2006-06-06 15:29:14 +00:00
Michael Brown 02df45352c Force pci.o to be included.
Print warning message at probe time.
2006-06-05 16:17:52 +00:00
Michael Brown 754cfdfcf4 Legacy drivers will not pad when necessary 2006-06-05 16:10:36 +00:00
Michael Brown 7826de3f7e PNIC doesn't auto-pad. 2006-06-05 16:10:14 +00:00
Michael Brown 286bf68faf Added a very quick and dirty compatibility layer, to allow
not-yet-updated drivers to at least function.
2006-06-05 15:45:21 +00:00
Michael Brown c3e41e6fd1 Added soon-to-be-requisite missing include. 2006-06-05 15:41:22 +00:00
Dan Lynch 34cfbf55a4 - added most slk functions 2006-06-05 15:03:11 +00:00
Michael Brown d78581297b Improve tcpdump legibility. 2006-06-01 19:23:52 +00:00
Michael Brown 6ab4b99f41 Quick hack to avoid trying to use an uninitialised net device. 2006-06-01 15:53:05 +00:00
Michael Brown 48fb6c6dc2 Updated retry timer mechanism to incorporate smoothed RTT estimation.
AoE now uses the retry timer mechanism.
2006-06-01 14:33:52 +00:00
Michael Brown 50415b3aca Make DBG_DISCARD correct 2006-06-01 12:11:09 +00:00
Michael Brown 1f394c2f7c Backing out last change; no immediate plans to make the whole block-device
layer asynchronous, so keeping the sync/async boundary within aoedev.c
seems cleanest for now.
2006-06-01 11:14:59 +00:00
Michael Brown d6866202f9 Until we have a functioning UDP stack and PXE API again, there's not much
point trying to use the old boot sequence.  Replaced with a call to the
AoE demo code, so that people can at least build and try something useful.
2006-06-01 11:07:31 +00:00
Michael Brown d21fc3610f Added sample AoE test code to tree 2006-06-01 11:05:36 +00:00
Michael Brown f6d20bb0f4 Put in a method to get the MAC address for the AoE target. (It's not
elegant, but it works).
2006-05-31 19:12:17 +00:00
Michael Brown 99ef98d0bf ATA devices are now asynchronous. The ATA layer itself now performs the
async_wait(), though we may wish to move this higher up the stack, and
consider making the block device model asynchronous.  (There is only a
marginal cost for synchronous devices, since they can simply call
async_done() before returning; async_wait() will work seamlessly in this
situation).
2006-05-31 18:57:11 +00:00
Michael Brown cf96d325d8 Missing from previous checkin.
This is the core portion of the async I/O interface.
2006-05-31 18:45:43 +00:00
Michael Brown 68125bc441 Added generic asynchronous operations code.
Removed data_in_len and data_out_len from ata_command structure; the
lengths are implied by the sector count and the presence of the data_in
or data_out pointers.

Changed AoE code to use subcommands by default, and made aoe_issue()
nonblocking (with completion via async_wait()).
2006-05-31 14:34:17 +00:00
Michael Brown 73a449e96b Added drivers/ata directory (forgot to check this in previously). 2006-05-31 14:31:48 +00:00
Michael Brown 552b4a178e One bit of an ASCII character can make a big difference. 2006-05-29 21:00:00 +00:00
Michael Brown 1db1a6dad3 Added first sketch of a generic retry timer mechanism. The idea is to use
these timer objects in AoE and UDP protocols (where there is no underlying
retransmission mechanism) without requiring each protocol to implement its
own individual retry logic.  Eventually, we should be able to use the same
timer code for TCP retransmissions as well.
2006-05-29 14:55:07 +00:00
Michael Brown 6541338897 Handle multi-sector reads by splitting them into subcommands. 2006-05-29 08:25:31 +00:00
Michael Brown 9a2a52693d Initial AoE implementation. Limitations are:
Cannot yet handle reads of more than two sectors

  No retransmission

  No way to find out a target's MAC address (this proof of concept uses
  broadcasts)

These limitations shall not last long!  :)
2006-05-28 23:29:43 +00:00
Michael Brown 6f998cecb3 Use separate data-in and data-out buffers.
Increase code simplicity at the expense of around 64 bytes.
2006-05-28 23:26:42 +00:00
Michael Brown 6d6252067f Add ETH_P_AOE 2006-05-28 21:47:52 +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 f743de4858 Added tcp_kick(). This speed up LILO and GRUB booting by almost two
orders of magnitude.
2006-05-27 19:01:20 +00:00
Michael Brown cd3ecac809 Avoid causing TX overflow on small TX queues. 2006-05-27 13:55:36 +00:00
Michael Brown 70ef6dbb7c Rewrote to use the new net driver API, the updated PCI API, and the
generic three-wire serial device support for EEPROM access.
2006-05-27 13:45:14 +00:00
Michael Brown 69b1f24a97 I have no idea how this ever worked before. 2006-05-27 13:43:56 +00:00
Michael Brown 6c50564724 Make PKB_ZLEN the minimum possible size of packet buffer (to allow for
hardware that can't autopad).
2006-05-27 13:39:45 +00:00
Michael Brown 1dbafa8950 Tidied up debugging messages 2006-05-27 13:38:49 +00:00
Michael Brown aa2468babe Added abstraction layer for a three-wire serial device (e.g. the EEPROM
used on RTL8139 cards).
2006-05-26 15:39:24 +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 0479e9f541 relocate.o is now dragged in by the objects that require it; there is no
need for a CONFIG_RELOCATE.
2006-05-25 01:34:13 +00:00
Michael Brown 3204a1e941 Removed some obsolete INIT_XXX constants. 2006-05-25 01:09:06 +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
Michael Brown 04d6005d77 Update to REAL_CODE() 2006-05-24 12:45:50 +00:00
Michael Brown 6631f46999 Updated to REAL_CODE(). 2006-05-24 12:32:57 +00:00
Michael Brown 53935e9dc6 Set carry flag before calling INT 15,e801 and INT 15,e820.
Ignore carry flag for INT 15,88; the Ralf Brown interrupt list says
that CF is unreliable for this call.
2006-05-24 12:19:16 +00:00
Michael Brown 7a53d07027 Split out REAL_CODE() from REAL_EXEC(), preparatory to removing REAL_EXEC
completely.
2006-05-24 09:51:04 +00:00
Michael Brown 83d80d9e79 Remove references to obsoleted REAL_CALL from documentation. 2006-05-24 09:16:48 +00:00
Michael Brown 3b525385af Removed REAL_FRAGMENT and REAL_CALL, and left just REAL_EXEC (which is
the only one we actually use).  This allows REAL_EXEC fragments to
contain proper references to constraints (e.g. "%w0"), rather than having
to force the use of specific registers.

Note that the "num_constraints" parameter is now completely obsolete, and
that we can probably reduce the syntax to something like
  __asm__ __volatile__ ( REAL_CODE ( "asm statements" )
                         : output constraints
                         : input constraints
                         : clobber );
which would look much more natural, and avoid the need to always specify
a clobber list.


Add userptr_t to libkir.h, to allow it to at least compile.
2006-05-24 09:14:44 +00:00
Michael Brown 77a65075a6 Replaced memsizes.c with smaller memmap.c, taking advantage of __data16,
and creating a memory map that's easier to work with than the E820 map.
2006-05-24 01:37:46 +00:00
Michael Brown 5e80847827 Code to install the new E820 mangler (which doesn't require copying
down to base memory, since it is now in the base-memory-resident
.text16 section).
2006-05-23 23:47:05 +00:00
Michael Brown 897313007b Add __{text,data}16_array, since there's no way I can see to make the
usual __{text,data}16 trick work with arrays.  gcc seems to accept the
__asm__ ( asmlabel ) only after the [] of the array declaration, not
before.
2006-05-23 23:42:45 +00:00
Michael Brown 5ec2b2c251 Cope with regions bigger than 4GB.
We now split e820 regions around ourselves, rather than just
truncating the e820 region.  This avoids the worst-case scenario of
losing all memory over 4GB.

It's more important to get the memory map right now that we're
expecting to still be loaded when the OS starts in several situations
(e.g. Linux with UNDI driver, any OS with iSCSI/AoE boot, etc.).
2006-05-23 23:33:37 +00:00
Dan Lynch bef8874842 - implemented printw (formatted string output, a la printf)
- implemented hline/vline (part of wborder family)
- screen cursor now relocates at same time as window cursor when
  restoring after a non-wrapping function
2006-05-22 17:03:41 +00:00
Michael Brown 84a493b88d Allow vcprintf() to be called by external code such as the curses library.
Also trim another eight bytes from vsprintf.o.  :)
2006-05-22 15:41:01 +00:00
Dan Lynch f778500739 - fixes to _wputch to get positioning and wrap working properly
- fixes to wborder (same)
- addition of a few minor functions
2006-05-22 13:10:19 +00:00
Michael Brown 95956443e1 Fixed debug code 2006-05-21 16:04:41 +00:00
Michael Brown 9dfb9d84b4 Made the LBA48 example clearer. 2006-05-21 16:02:38 +00:00
Michael Brown 80958ff69c Added (untested) support for ATA devices. This code should be generic
enough to support both real IDE chipsets and AoE.
2006-05-21 16:01:23 +00:00
Michael Brown ca2519cea3 Refactored to reduce code size; now down from 1304 to 1105 bytes.
Tidied up debug messages; the log now contains one line per INT 13
operation, looking like

 INT 13,08 (80): Get drive parameters
 INT 13,02 (80): Read: C/H/S 0/47/14 = LBA 0xb9e <-> 1084:0000 (count 106)
2006-05-20 15:33:32 +00:00
Michael Brown af4aacb978 Added missing @file block 2006-05-20 13:25:07 +00:00
Michael Brown 4d0a0f822d Use insb/outsb; it's marginally faster. 2006-05-20 12:28:44 +00:00
Michael Brown 402ba15c64 READ CAPACITY (16) turns out to be an optional command (even though
READ(16) is mandatory); we must use READ CAPACITY (10) first and then
use READ CAPACITY (16) if the READ CAPACITY (10) returns "out of range".
2006-05-19 18:54:38 +00:00
Michael Brown 444b885a7d Add EOVERFLOW==ERANGE 2006-05-19 18:53:12 +00:00
Michael Brown b9cbae58fa Expert advice tells me that we *do* have to explicitly state the
options even when we want to use the defaults.
2006-05-19 17:50:49 +00:00
Dan Lynch acf572905c - made some of the bit shifting attribute access simpler (in my mind)
- added extern declarations for global vars
- removed comments from static inlines (too time consuming to do them
  all, considering all so far have been due to the ridiculous amount of
  redundancy within the API spec)
- removed a few more extern func decls for funcs that cannot be
  implemented at this time
2006-05-19 16:22:10 +00:00
Dan Lynch d166dc57ab - made _wputch wrap lines as well as cols (wraps back to line 0, as we have not way to scroll...)
- implemented color_content, wborder, wblrtobot, wclrtoeol, wcolor_set and several small functions
- added rest of expected global variables
2006-05-19 16:18:08 +00:00
Michael Brown d48d0fb1bb Add the concept of a "user pointer" (similar to the void __user * in
the kernel), which encapsulates the information needed to refer to an
external buffer.  Under normal operation, this can just be a void *
equivalent, but under -DKEEP_IT_REAL it would be a segoff_t equivalent.

Use this concept to avoid the need for bounce buffers in int13.c,
which reduces memory usage and opens up the possibility of using
multi-sector reads.

Extend the block-device API and the SCSI block device implementation
to support multi-sector reads.

Update iscsi.c to use user buffers.

Move the obsolete portions of realmode.h to old_realmode.h.

MS-DOS now boots an order of magnitude faster over iSCSI (~10 seconds
from power-up to C:> prompt in bochs).
2006-05-19 15:06:51 +00:00
Michael Brown 0ab92faedb Use typeof(sizeof(...)) to define a size_t. This stops gcc complaining
about format errors for %zX arguments.
2006-05-19 14:51:59 +00:00
Michael Brown c69c1ec540 Documented login parameters that we negotiate. 2006-05-19 00:31:42 +00:00
Michael Brown a280587cde iSCSI writes seem to be working (at least, the ethereal trace shows no
errors; still need to verify data integrity).

SCSI response PDUs are handled: status and sense data (if available) are
returned via the scsi_command structure.

Updated iSCSI session parameter usage.
2006-05-19 00:20:08 +00:00
Michael Brown b531bd2bda All uses iscsi_state were removed some time ago; removing the
declaration.
2006-05-18 21:38:16 +00:00
Michael Brown 53b682f3a2 Re-enable -Wformat, since our printf() is now more standards-conformant. 2006-05-18 21:23:38 +00:00
Dan Lynch 2814681d20 all window primitives implemented 2006-05-18 17:51:19 +00:00
Michael Brown 813a052dc3 Set ErrorRecoveryLevel=0 (we don't want to have to handle it). 2006-05-17 17:41:50 +00:00
Michael Brown 61d7b8a5ef Added missing drivers/scsi 2006-05-17 17:31:18 +00:00
Michael Brown a4143e8c87 Split debug functions out into core/debug.c, so that they can be
automatically linked in on demand.

Corrected warnings in misc.c.  strtoul() really should be
  unsigned long strtoul ( const char *p, const char **endp, int base )
but such is not the ANSI standard.
2006-05-17 17:16:24 +00:00
Michael Brown 6b6096d28b Strip down i386 PCI configuration space I/O to the bare minimum. A
typical build will now include 880 bytes of PCI support code, compared to
2327 bytes in Etherboot 5.4.

(There is a slight cost of around 5 extra bytes per access to a
non-constant config space address; this should be an overall win.
Driver-specific accesses will usually be to constant addresses, for
which there is no additional cost.)
2006-05-17 01:12:11 +00:00
Michael Brown 15ee09ed10 Restructured PCI subsystem to fit the new device model.
Generic PCI code now handles 64-bit BARs correctly when setting
"membase"; drivers should need to call pci_bar_start() only if they want
to use BARs other than the first memory or I/O BAR.

Split rarely-used PCI functions out into pciextra.c.

Core PCI code is now 662 bytes (down from 1308 bytes in Etherboot 5.4).
284 bytes of this saving comes from the pci/pciextra split.

Cosmetic changes to lots of drivers (e.g. vendor_id->vendor in order to
match the names used in Linux).
2006-05-16 15:12:06 +00:00
Michael Brown fcdab6299c Missed a reference to heap.h. 2006-05-16 15:01:26 +00:00
Michael Brown 0afa9db2de Tear out old heap code, replace with code that simply allocates memory
for use by malloc().

This breaks the image-loading code (which previously used the heap to
allocate the buffer for downloading the image), but that's not a major
concern since I'm going to tear out all the image formats within the next
couple of days anyway.  Byebye, NBI!  :)
2006-05-16 15:00:36 +00:00
Michael Brown 689218618f Fix typo 2006-05-16 14:42:43 +00:00
Michael Brown 441189c6f8 Kill off the "all devices are boot devices" idea 2006-05-16 14:42:15 +00:00
Michael Brown 7cd0390013 Add list_for_each_entry_safe. 2006-05-16 14:14:31 +00:00
Michael Brown ceba6ecb75 Added generic device model. 2006-05-16 14:10:21 +00:00
Michael Brown 6b514393d3 Change movetoyx(), putc() and getc() to methods of the screen. 2006-05-15 09:51:18 +00:00
Dan Lynch a2799051b0 fixed build error (danjlynch, repeat: this is *not* perl, this is *not* perl...) 2006-05-15 09:34:27 +00:00
Dan Lynch dccc6aed3a lightweight xcurses implementation for etherboot (Michael made me do it...) 2006-05-15 09:29:48 +00:00
Michael Brown 295e11b2b0 Add INT 13,41 (extensions installation check). LILO's MBR now uses
linear calls to load the MS-DOS boot sector in my test setup.
2006-05-14 23:46:28 +00:00
Michael Brown f25731d08f Split "iSCSI as a SCSI device" out from "iSCSI as a TCP protocol". 2006-05-14 23:29:16 +00:00
Michael Brown 29fb77b0a4 Fix a couple of minor typos. 2006-05-14 18:17:29 +00:00
Michael Brown 6e42cb95bd Also capture INT 19 as a failure path, to allow for boot sectors that
don't conform to BBS (e.g. the one created by mkdosfs).
2006-05-14 14:13:55 +00:00
Michael Brown 4435667a00 Add int13_boot(), to allow booting from INT 13 emulated drives. 2006-05-14 13:44:47 +00:00
Michael Brown b4f941b257 Specify attributes on .text16. 2006-05-14 13:39:27 +00:00
Michael Brown eb6b8e8d70 Handle the '"%c", 0' case correctly. 2006-05-14 11:55:30 +00:00
Michael Brown efd6281a35 Correctly handle zero-length buffers. 2006-05-14 11:18:42 +00:00
Michael Brown 25f5d114a0 Updated documentation.
Shaved around 100 bytes off vsprintf.o.  It's now 50 bytes smaller than
the old implementation and provides much more conformant semantics,
including the ability to return the number of characters that would have
been printed to the string had the buffer been big enough.  (iSCSI needs
this functionality).
2006-05-14 03:31:20 +00:00
Michael Brown 2421723a15 Rewrote printf and friends to better support standard C semantics. 2006-05-14 02:51:55 +00:00
Michael Brown f99e7a375e At least cope with "%llx" by reading the correct-sized va_arg from the
stack, even if we don't yet print it out.

At some point, vsprintf() needs to be fixed up so that it can correctly
cope with limited-sized buffers (i.e. vsnprintf), long longs, and
standard format specifiers (e.g. "%04x").  We should also remove the
special types (MAC addresses and IP addresses).  This would then enable
us to use gcc's ability to type-check printf format strings.
2006-05-13 11:50:52 +00:00
Michael Brown 21493646c2 Moved to net/tcp/iscsi.c. 2006-05-13 11:45:49 +00:00
Michael Brown 5080668704 Provide access to rm_cs and rm_ds from protected-mode code. 2006-05-13 11:45:31 +00:00
Michael Brown dc8d429ec6 Provide a global counter for the number of interrupts hooked. 2006-05-13 11:44:53 +00:00
Michael Brown 63499e9cfd Allow re-entrancy and provide a global counter of the number of
interrupts hooked.
2006-05-13 11:44:11 +00:00
Michael Brown d822b3d4cd Define BIOS data segment in bios.h 2006-05-13 11:43:07 +00:00
Michael Brown a27defa483 Add flag definitions. 2006-05-13 11:42:07 +00:00
Michael Brown d2c22ec9bb Add INT 13 emulation layer (which provides an interface to gPXE block
devices).
2006-05-13 11:41:36 +00:00
Michael Brown 1ad72e0e79 Add 64-bit byte-swapping operations. 2006-05-13 11:40:39 +00:00
Michael Brown 5009f8d6a2 Provide a SCSI device interface to the iSCSI protocol 2006-05-13 11:39:46 +00:00
Michael Brown f33f01c126 Defined SCSI device interface, and added SCSI block device
implementation.
2006-05-13 11:37:50 +00:00
Michael Brown 8638a5e471 Defined a block device interface. 2006-05-13 11:36:30 +00:00
Michael Brown 1838b58c3f Add drivers/block and arch/i386/interface/pcbios 2006-05-13 11:35:29 +00:00
Michael Brown 568cad0ddc (Redoing check-in lost by SourceForge's failure.) 2006-05-13 11:30:03 +00:00
Michael Brown 8a229a16f6 (Redoing check-in lost by SourceForge's failure.)
Moved to net/
2006-05-13 11:24:25 +00:00
Michael Brown 847f38f4ac (Redoing check-in lost by SourceForge's failure.)
Add method for hooking real-mode interrupt vectors.
2006-05-13 11:19:06 +00:00
Michael Brown f7b963da51 (Redoing check-in lost by SourceForge's failure.)
Use .text16.data section with "aw" attributes, to avoid section type
conflicts when placing both code and data into .text16.

Add __from_{text16,data16}.
2006-05-13 11:11:55 +00:00
Michael Brown 97d265f8dc (Redoing check-in lost by SourceForge's failure.)
Avoid optimisation errors under -fstrict-aliasing.
2006-05-13 11:10:24 +00:00
Michael Brown fdb983d473 Preserve the whole of %esp across prot_call(). We have to split this
between the low half stored in the static variable rm_sp, and the high
half stored on the prot_call() stack, because:

  Just using the stack would screw up when a prot_call()ed routine
  executes a real_call(); it would have no way to find the current top of
  the RM stack.

  Extending rm_sp to rm_esp would not be safe, because the guarantee that
  rm_sp must return to the correct value by the time an external
  real-mode call returns applies only to %sp, not to %esp.
2006-05-06 19:44:23 +00:00
Michael Brown f8e087767b Allow access to variables in .text16 as well as .data16. Chained
interrupt vectors, for example, will be easiest to handle if placed in
.text16.
2006-05-06 18:57:31 +00:00
Michael Brown c10d1aa9d7 Preserve GDT across prot_call(). 2006-05-06 18:52:27 +00:00
Michael Brown dcc1b0054e This line should not have been checked in 2006-05-04 23:22:42 +00:00
Michael Brown 832807726a Add infrastructure to support access to .data16 (and .text16) variables
from protected-mode code.

Set up %ds to point to .data16 in prot_to_real, so that code specified
via REAL_EXEC() and friends can access variables in .data16.

Move most real-mode librm variables from .text16 to .data16.
2006-05-04 23:14:06 +00:00
Michael Brown f4429533a6 Added methods for efficiently declaring and accessing variables in
.data16.  librm will need to supply "char *data16", i.e. the virtual
address of the start of .data16.
2006-05-04 17:00:20 +00:00
Michael Brown f8f75cef5b BSS is now zeroed by libprefix (along with the otherwise non-zeroable
portions such as the stack) during the installation process.

init_fns() are called from main().  We need to think about initial
control flow some more.
2006-05-02 21:10:45 +00:00
Michael Brown cc23057b59 Typo 2006-05-02 21:09:29 +00:00
Michael Brown 10c28a51bd Create two easy-to-use entry points in libprefix: install and
install_prealloc.  I *think* these will suffice for all the 16-bit
prefixes.
2006-05-02 20:51:07 +00:00
Michael Brown 9e1dd6402d <name>_size variable is no longer needed, since we don't copy the code.
However, it's worth adding a .size directive so that objdump reports the
correct sizes for the code fragments.
2006-05-02 16:38:46 +00:00
Michael Brown 9fcded3d23 Towards a(nother) new real-mode infrastructure, in which we take
advantage of the fact that we have to have a permanently-resident block
in base memory.
2006-05-02 15:41:21 +00:00
Michael Brown 8f62b39c03 Move stack out to separate object, so that having a stack doesn't drag in
setup.S.
2006-05-02 14:57:48 +00:00
Michael Brown 5463169c1a Verified as working 2006-05-02 14:04:21 +00:00
Michael Brown d081d65d48 This should be much more elegant: we use flat real mode for the
highmem data, so decompress16 will be able to unpack blocks bigger
than 64kB.
2006-05-01 22:35:19 +00:00
Michael Brown cc8821a443 Checking in because I don't want to lose this rather neat code for
running the decompresser in 16:16 protected mode using the real-mode
stack.  However, there's an even simpler way to do it...
2006-05-01 21:26:44 +00:00
Michael Brown 2462047128 Typo 2006-04-30 18:19:39 +00:00
Michael Brown 9e1becaf8a Merge TCP aborted(), timedout() and closed() methods into a single
closed() method with a reason code.
2006-04-30 16:59:45 +00:00
Michael Brown 8afb6303fb Half-way tidy 2006-04-30 15:23:29 +00:00