Michael Brown [Tue, 23 May 2006 23:47:05 +0000 (23:47 +0000)]
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).
Michael Brown [Tue, 23 May 2006 23:42:45 +0000 (23:42 +0000)]
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.
Michael Brown [Tue, 23 May 2006 23:33:37 +0000 (23:33 +0000)]
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.).
Dan Lynch [Mon, 22 May 2006 17:03:41 +0000 (17:03 +0000)]
- 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
Michael Brown [Mon, 22 May 2006 15:41:01 +0000 (15:41 +0000)]
Allow vcprintf() to be called by external code such as the curses library.
Also trim another eight bytes from vsprintf.o. :)
Dan Lynch [Mon, 22 May 2006 13:10:19 +0000 (13:10 +0000)]
- fixes to _wputch to get positioning and wrap working properly
- fixes to wborder (same)
- addition of a few minor functions
Michael Brown [Sun, 21 May 2006 16:04:41 +0000 (16:04 +0000)]
Fixed debug code
Michael Brown [Sun, 21 May 2006 16:02:38 +0000 (16:02 +0000)]
Made the LBA48 example clearer.
Michael Brown [Sun, 21 May 2006 16:01:23 +0000 (16:01 +0000)]
Added (untested) support for ATA devices. This code should be generic
enough to support both real IDE chipsets and AoE.
Michael Brown [Sat, 20 May 2006 15:33:32 +0000 (15:33 +0000)]
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)
Michael Brown [Sat, 20 May 2006 13:25:07 +0000 (13:25 +0000)]
Added missing @file block
Michael Brown [Sat, 20 May 2006 12:28:44 +0000 (12:28 +0000)]
Use insb/outsb; it's marginally faster.
Michael Brown [Fri, 19 May 2006 18:54:38 +0000 (18:54 +0000)]
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".
Michael Brown [Fri, 19 May 2006 18:53:12 +0000 (18:53 +0000)]
Add EOVERFLOW==ERANGE
Michael Brown [Fri, 19 May 2006 17:50:49 +0000 (17:50 +0000)]
Expert advice tells me that we *do* have to explicitly state the
options even when we want to use the defaults.
Dan Lynch [Fri, 19 May 2006 16:22:10 +0000 (16:22 +0000)]
- 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
Dan Lynch [Fri, 19 May 2006 16:18:08 +0000 (16:18 +0000)]
- 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
Michael Brown [Fri, 19 May 2006 15:06:51 +0000 (15:06 +0000)]
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).
Michael Brown [Fri, 19 May 2006 14:51:59 +0000 (14:51 +0000)]
Use typeof(sizeof(...)) to define a size_t. This stops gcc complaining
about format errors for %zX arguments.
Michael Brown [Fri, 19 May 2006 00:31:42 +0000 (00:31 +0000)]
Documented login parameters that we negotiate.
Michael Brown [Fri, 19 May 2006 00:20:08 +0000 (00:20 +0000)]
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.
Michael Brown [Thu, 18 May 2006 21:38:16 +0000 (21:38 +0000)]
All uses iscsi_state were removed some time ago; removing the
declaration.
Michael Brown [Thu, 18 May 2006 21:23:38 +0000 (21:23 +0000)]
Re-enable -Wformat, since our printf() is now more standards-conformant.
Dan Lynch [Thu, 18 May 2006 17:51:19 +0000 (17:51 +0000)]
all window primitives implemented
Michael Brown [Thu, 18 May 2006 13:22:32 +0000 (13:22 +0000)]
Updated to new SourceForge CVS locations, and fix a couple of minor
mistakes.
Michael Brown [Wed, 17 May 2006 17:41:50 +0000 (17:41 +0000)]
Set ErrorRecoveryLevel=0 (we don't want to have to handle it).
Michael Brown [Wed, 17 May 2006 17:31:18 +0000 (17:31 +0000)]
Added missing drivers/scsi
Michael Brown [Wed, 17 May 2006 17:16:24 +0000 (17:16 +0000)]
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.
Michael Brown [Wed, 17 May 2006 01:12:11 +0000 (01:12 +0000)]
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.)
Michael Brown [Tue, 16 May 2006 15:12:06 +0000 (15:12 +0000)]
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).
Michael Brown [Tue, 16 May 2006 15:01:26 +0000 (15:01 +0000)]
Missed a reference to heap.h.
Michael Brown [Tue, 16 May 2006 15:00:36 +0000 (15:00 +0000)]
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! :)
Michael Brown [Tue, 16 May 2006 14:42:43 +0000 (14:42 +0000)]
Fix typo
Michael Brown [Tue, 16 May 2006 14:42:15 +0000 (14:42 +0000)]
Kill off the "all devices are boot devices" idea
Michael Brown [Tue, 16 May 2006 14:14:31 +0000 (14:14 +0000)]
Add list_for_each_entry_safe.
Michael Brown [Tue, 16 May 2006 14:10:21 +0000 (14:10 +0000)]
Added generic device model.
Michael Brown [Mon, 15 May 2006 09:51:18 +0000 (09:51 +0000)]
Change movetoyx(), putc() and getc() to methods of the screen.
Dan Lynch [Mon, 15 May 2006 09:34:27 +0000 (09:34 +0000)]
fixed build error (danjlynch, repeat: this is *not* perl, this is *not* perl...)
Dan Lynch [Mon, 15 May 2006 09:29:48 +0000 (09:29 +0000)]
lightweight xcurses implementation for etherboot (Michael made me do it...)
Michael Brown [Sun, 14 May 2006 23:46:28 +0000 (23:46 +0000)]
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.
Michael Brown [Sun, 14 May 2006 23:29:16 +0000 (23:29 +0000)]
Split "iSCSI as a SCSI device" out from "iSCSI as a TCP protocol".
Michael Brown [Sun, 14 May 2006 18:17:29 +0000 (18:17 +0000)]
Fix a couple of minor typos.
Michael Brown [Sun, 14 May 2006 14:13:55 +0000 (14:13 +0000)]
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).
Michael Brown [Sun, 14 May 2006 13:44:47 +0000 (13:44 +0000)]
Add int13_boot(), to allow booting from INT 13 emulated drives.
Michael Brown [Sun, 14 May 2006 13:39:27 +0000 (13:39 +0000)]
Specify attributes on .text16.
Michael Brown [Sun, 14 May 2006 11:55:30 +0000 (11:55 +0000)]
Handle the '"%c", 0' case correctly.
Michael Brown [Sun, 14 May 2006 11:18:42 +0000 (11:18 +0000)]
Correctly handle zero-length buffers.
Michael Brown [Sun, 14 May 2006 03:31:20 +0000 (03:31 +0000)]
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).
Michael Brown [Sun, 14 May 2006 02:51:55 +0000 (02:51 +0000)]
Rewrote printf and friends to better support standard C semantics.
Michael Brown [Sat, 13 May 2006 11:50:52 +0000 (11:50 +0000)]
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.
Michael Brown [Sat, 13 May 2006 11:45:49 +0000 (11:45 +0000)]
Moved to net/tcp/iscsi.c.
Michael Brown [Sat, 13 May 2006 11:45:31 +0000 (11:45 +0000)]
Provide access to rm_cs and rm_ds from protected-mode code.
Michael Brown [Sat, 13 May 2006 11:44:53 +0000 (11:44 +0000)]
Provide a global counter for the number of interrupts hooked.
Michael Brown [Sat, 13 May 2006 11:44:11 +0000 (11:44 +0000)]
Allow re-entrancy and provide a global counter of the number of
interrupts hooked.
Michael Brown [Sat, 13 May 2006 11:43:07 +0000 (11:43 +0000)]
Define BIOS data segment in bios.h
Michael Brown [Sat, 13 May 2006 11:42:07 +0000 (11:42 +0000)]
Add flag definitions.
Michael Brown [Sat, 13 May 2006 11:41:36 +0000 (11:41 +0000)]
Add INT 13 emulation layer (which provides an interface to gPXE block
devices).
Michael Brown [Sat, 13 May 2006 11:40:39 +0000 (11:40 +0000)]
Add 64-bit byte-swapping operations.
Michael Brown [Sat, 13 May 2006 11:39:46 +0000 (11:39 +0000)]
Provide a SCSI device interface to the iSCSI protocol
Michael Brown [Sat, 13 May 2006 11:37:50 +0000 (11:37 +0000)]
Defined SCSI device interface, and added SCSI block device
implementation.
Michael Brown [Sat, 13 May 2006 11:36:30 +0000 (11:36 +0000)]
Defined a block device interface.
Michael Brown [Sat, 13 May 2006 11:35:29 +0000 (11:35 +0000)]
Add drivers/block and arch/i386/interface/pcbios
Michael Brown [Sat, 13 May 2006 11:30:03 +0000 (11:30 +0000)]
(Redoing check-in lost by SourceForge's failure.)
Michael Brown [Sat, 13 May 2006 11:24:25 +0000 (11:24 +0000)]
(Redoing check-in lost by SourceForge's failure.)
Moved to net/
Michael Brown [Sat, 13 May 2006 11:19:06 +0000 (11:19 +0000)]
(Redoing check-in lost by SourceForge's failure.)
Add method for hooking real-mode interrupt vectors.
Michael Brown [Sat, 13 May 2006 11:11:55 +0000 (11:11 +0000)]
(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}.
Michael Brown [Sat, 13 May 2006 11:10:24 +0000 (11:10 +0000)]
(Redoing check-in lost by SourceForge's failure.)
Avoid optimisation errors under -fstrict-aliasing.
Michael Brown [Sat, 13 May 2006 09:27:54 +0000 (09:27 +0000)]
Added tunctl (since it is difficult to find for many distros).
Michael Brown [Sat, 6 May 2006 19:44:23 +0000 (19:44 +0000)]
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.
Michael Brown [Sat, 6 May 2006 18:57:31 +0000 (18:57 +0000)]
Allow access to variables in .text16 as well as .data16. Chained
interrupt vectors, for example, will be easiest to handle if placed in
.text16.
Michael Brown [Sat, 6 May 2006 18:52:27 +0000 (18:52 +0000)]
Preserve GDT across prot_call().
Michael Brown [Thu, 4 May 2006 23:22:42 +0000 (23:22 +0000)]
This line should not have been checked in
Michael Brown [Thu, 4 May 2006 23:14:06 +0000 (23:14 +0000)]
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.
Michael Brown [Thu, 4 May 2006 17:00:20 +0000 (17:00 +0000)]
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.
Michael Brown [Tue, 2 May 2006 21:10:45 +0000 (21:10 +0000)]
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.
Michael Brown [Tue, 2 May 2006 21:09:29 +0000 (21:09 +0000)]
Typo
Michael Brown [Tue, 2 May 2006 20:51:07 +0000 (20:51 +0000)]
Create two easy-to-use entry points in libprefix: install and
install_prealloc. I *think* these will suffice for all the 16-bit
prefixes.
Michael Brown [Tue, 2 May 2006 16:38:46 +0000 (16:38 +0000)]
<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.
Michael Brown [Tue, 2 May 2006 15:41:21 +0000 (15:41 +0000)]
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.
Michael Brown [Tue, 2 May 2006 14:57:48 +0000 (14:57 +0000)]
Move stack out to separate object, so that having a stack doesn't drag in
setup.S.
Michael Brown [Tue, 2 May 2006 14:04:21 +0000 (14:04 +0000)]
Verified as working
Michael Brown [Mon, 1 May 2006 22:35:19 +0000 (22:35 +0000)]
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.
Michael Brown [Mon, 1 May 2006 21:26:44 +0000 (21:26 +0000)]
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...
Michael Brown [Sun, 30 Apr 2006 18:19:39 +0000 (18:19 +0000)]
Typo
Michael Brown [Sun, 30 Apr 2006 16:59:45 +0000 (16:59 +0000)]
Merge TCP aborted(), timedout() and closed() methods into a single
closed() method with a reason code.
Michael Brown [Sun, 30 Apr 2006 15:23:29 +0000 (15:23 +0000)]
Half-way tidy
Michael Brown [Sun, 30 Apr 2006 13:20:40 +0000 (13:20 +0000)]
Make all TCP methods optional; at least FTP data is a read-only
connection and so legitimately ignores acked() and senddata().
Michael Brown [Sun, 30 Apr 2006 12:02:07 +0000 (12:02 +0000)]
Proof-of-concept FTP implementation
Michael Brown [Sun, 30 Apr 2006 12:01:31 +0000 (12:01 +0000)]
Add a temporary snprintf, so that safely-written code can at least
compile, even if it won't yet be safe.
Michael Brown [Sun, 30 Apr 2006 11:45:38 +0000 (11:45 +0000)]
Fix up prototype of strtoul() to match POSIX.
Michael Brown [Sun, 30 Apr 2006 09:34:11 +0000 (09:34 +0000)]
Created net/tcp and moved hello.c there
Michael Brown [Sun, 30 Apr 2006 02:13:52 +0000 (02:13 +0000)]
Make tcp_connect() void; it will eventually have no failure case.
Michael Brown [Sun, 30 Apr 2006 02:08:42 +0000 (02:08 +0000)]
Put the TCP connection periodic processing in tcp.c, where it belongs.
Michael Brown [Sun, 30 Apr 2006 01:35:01 +0000 (01:35 +0000)]
Consistency
Michael Brown [Sun, 30 Apr 2006 01:16:37 +0000 (01:16 +0000)]
Moved uIP and tcp.c from proto/ to net/
Michael Brown [Sun, 30 Apr 2006 01:08:52 +0000 (01:08 +0000)]
Move init.h to gpxe/init.h.
Michael Brown [Sat, 29 Apr 2006 17:17:43 +0000 (17:17 +0000)]
Change semantics of network API so that packet-absorbing calls *always*
take ownership of the packet, rather than doing so only if they return
success. This breaks semantic compatibility with Linux's
hard_start_xmit() method, but means that we don't have to worry so much
about error cases.
Split mechanism of processing received packets (net_rx_process()) out
from policy (net_step()), preparatory to putting net_step() in a separate
object.
Michael Brown [Sat, 29 Apr 2006 16:42:09 +0000 (16:42 +0000)]
Added basic code for implementing co-operative multitasking.
Yes, you really can do it in 65 bytes.
Michael Brown [Fri, 28 Apr 2006 14:15:21 +0000 (14:15 +0000)]
Give uIP a static IP address for proof-of-concept testing
Michael Brown [Fri, 28 Apr 2006 14:13:50 +0000 (14:13 +0000)]
Network layer now works as a proof of concept