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

46 Commits

Author SHA1 Message Date
Michael Brown b0c818d7b5 [int13] Improve debugging messages 2009-03-31 06:26:51 +01:00
Michael Brown 4dd746a725 [iscsi] Include credentials in iBFT only if used during iSCSI login
Avoid passing credentials in the iBFT that were available but not
required for login.  This works around a problem in the Microsoft
iSCSI initiator, which will refuse to initiate sessions if the CHAP
password is fewer than 12 characters, even if the target ends up not
asking for CHAP authentication.
2009-02-20 21:41:00 +00:00
Michael Brown 46da51703a [umalloc] Avoid problems when _textdata_memsz is a multiple of 4kB
If it happens that _textdata_memsz ends up being an exact multiple of
4kB, then this will cause the .textdata section (after relocation) to
start on a page boundary.  This means that the hidden memory region
(which is rounded down to the nearest page boundary) will start
exactly at virtual address 0, i.e. UNULL.  This means that
init_eheap() will erroneously assume that it has failed to allocate a
an external heap, since it typically ends up choosing the area that
lies immediately below .textdata, which in this case will be the
region with top==UNULL.

A subsequent error is that memtop_urealloc() passes through the error
return status -ENOMEM to the caller, which (rightly) assumes that the
result represents a valid userptr_t address.

Fixed by using alternative tests for heap non-existence, and by
returning UNULL in case of an error from init_eheap().
2009-02-15 07:56:16 +00:00
Michael Brown 29480dd715 [efi] Use EFI-native mechanism for accessing SMBIOS table
EFI provides a copy of the SMBIOS table accessible via the EFI system
table, which we should use instead of manually scanning through the
F000:0000 segment.
2008-12-04 23:19:12 +00:00
Michael Brown e78bcb6175 [netdevice] Kill off the various guess_boot_netdev() functions
Remove the assortment of miscellaneous hacks to guess the "network
boot device", and replace them each with a call to last_opened_netdev().

It still isn't guaranteed correct, but it won't be any worse than
before, and it will at least be consistent.
2008-11-21 20:34:42 +00:00
Laurent Vivier a2686a55c4 [blockdev] Move block device operations to structure block_device_operations
Signed-off-by: Laurent Vivier <Laurent.Vivier@bull.net>
2008-11-19 20:04:43 +00:00
Michael Brown d9b3d09910 [i386] Move iSCSI and AoE boot code to arch/i386/interface/pcbios 2008-11-19 19:20:45 +00:00
Michael Brown dc60c24146 [i386] Rename __cdecl to __asmcall
__cdecl is a misleading name, since it currently encapsulates both
cdecl and regparm(0) attributes.  Rename to __asmcall.
2008-11-19 19:12:53 +00:00
Michael Brown 0a8a17e669 [i386] Free allocated base memory on exit, if possible
Code paths that automatically allocate memory from the FBMS at 40:13
should also free it, if possible.

Freeing this memory will not be possible if either

  1. The FBMS has been modified since our allocation, or

  2. We have not been able to unhook one or more BIOS interrupt vectors.
2008-11-18 19:43:13 +00:00
Michael Brown 831e4cfc27 [umalloc] Formalise the user memory allocation API 2008-10-13 05:33:14 +01:00
Michael Brown c0835339d0 [nap] Formalise the CPU sleeping API 2008-10-12 23:36:53 +01:00
Michael Brown 16f1e35775 [timer] Formalise the timer API
We now have two implementations for the timer API: one using the
time-of-day counter at 40:70 and one using RDTSC.  Both make use of
timer2_udelay().
2008-10-12 20:22:02 +01:00
Michael Brown 8a4ccebec9 [pci] Formalise the PCI I/O API 2008-10-12 12:54:12 +01:00
Michael Brown bb41ec385c [int13] Pairwise swap drive numbers, instead of shifting all drive numbers
Shifting all INT13 drive numbers causes problems on systems that use a
sparse drive number space (e.g. qemu BIOS, which uses 0xe0 for the CD-ROM
drive).

The strategy now is:

  Each drive is assigned a "natural" drive number, being the next
  available drive number in the system (based on the BIOS drive count).

  Each drive is accessed using its specified drive number.  If the
  specified drive number is -1, the natural drive number will be used.

  Accesses to the specified drive number will be delivered to the
  emulated drive, masking out any preexisting drive using this number.

  Accesses to the natural drive number, if different, will be remapped to
  the masked-out drive.

The overall upshot is that, for examples:

  System has no drives.  Emulated INT13 drive gets natural number 0x80
  and specified number 0x80.  Accesses to drive 0x80 go to the emulated
  drive, and there is no remapping.

  System has one drive.  Emulated INT13 drive gets natural number 0x81
  and specified number 0x80.  Accesses to drive 0x80 go to the emulated
  drive.  Accesses to drive 0x81 get remapped to the original drive 0x80.
2008-07-15 23:19:59 +01:00
Michael Brown a7eee64506 Added more verbose memory-map debugging.
Added redundant call to get_memmap() in int13_boot() immediately
before jumping to boot sector, to assist in debugging.
2007-09-21 18:33:17 +01:00
Michael Brown 01b755704a Auto-assign drive number only if set to 0xff; almost all applications
require that we use drive 0x80, so it should probably be the default.
2007-08-23 20:50:24 +01:00
Michael Brown a6a1052096 Applied a modified version of holger's regparm patches. 2007-07-29 00:17:25 +01:00
Michael Brown 09118cd5bf Don't overwrite %dl with a (potentially) modified drive number if we
already handled the INT13 call.
2007-07-25 02:03:29 +01:00
Michael Brown a8111e8ab7 Remove INT 13,4b handler; it represents an incomplete feature (CD-ROM
emulation support) for an unknown purpose, and breaks grub.
2007-07-19 11:16:05 +01:00
Michael Brown 0d9d2ccbae Completed definition of struct int13_cdrom_specification, and moved to
int13.h.
2007-07-19 11:15:01 +01:00
Michael Brown fb16f90699 Dump first 64 bytes of chained ISR when debugging is enabled. 2007-07-10 16:57:55 +01:00
Michael Brown 19871cbb96 We probably ought not to call INT13 with interrupts disabled. 2007-07-10 04:32:30 +01:00
Michael Brown cd7e296cbe Always increase number of BIOS drives when registering 2007-07-09 20:42:04 +01:00
Michael Brown b90d321dfb Change %dl fixup rules for INT13:
INT 13,08 : read number of drives from 40:75
INT 13,15 : do nothing
all others : restore original value of %dl
2007-07-09 20:37:39 +01:00
Michael Brown c7d9fdb5b9 Proof of concept; works, but has several hard-coded hacks. 2007-07-09 20:28:40 +01:00
Michael Brown 8bce52d348 Set CF by default, clear on success (rather than clearing and setting
on failure).
2007-07-09 19:02:41 +01:00
Michael Brown 2cf1e33df1 Split bootsector execution code out into bootsector.c.
Added basic El Torito ISO image boot capability
2007-01-29 04:21:38 +00:00
Michael Brown a2ffe8c123 Allow boot sector to completely destroy real-mode stack, but still
manage to return control.
2007-01-09 14:13:59 +00:00
Michael Brown a6ba48e51e Added debugging statements 2007-01-08 03:04:54 +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
Michael Brown 0566ab2a2f Added geometry-guessing code based on the partition table 2006-09-08 22:22:03 +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 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 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 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 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 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 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 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 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 d2c22ec9bb Add INT 13 emulation layer (which provides an interface to gPXE block
devices).
2006-05-13 11:41:36 +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