aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authoraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-22 06:49:43 +0000
committeraurel32 <aurel32@c046a42c-6fe2-441c-8c8c-71466251a162>2008-04-22 06:49:43 +0000
commitddc2db503dd374ae0355dfd5d0dcb60aa5ec47ac (patch)
tree70156fe8b4ed9de3faa90b3328a79599ef86e0a6 /hw
parent942ac05261a4e913ce347501b811555cb48cda60 (diff)
x86: remove load_kernel()
(Jan Kiszka) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4233 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'hw')
-rw-r--r--hw/pc.c31
1 files changed, 0 insertions, 31 deletions
diff --git a/hw/pc.c b/hw/pc.c
index 44a021bc23..abd96f0fb3 100644
--- a/hw/pc.c
+++ b/hw/pc.c
@@ -445,37 +445,6 @@ static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip)
bdrv_set_boot_sector(drives_table[hda].bdrv, bootsect, sizeof(bootsect));
}
-static int load_kernel(const char *filename, uint8_t *addr,
- uint8_t *real_addr)
-{
- int fd, size;
- int setup_sects;
-
- fd = open(filename, O_RDONLY | O_BINARY);
- if (fd < 0)
- return -1;
-
- /* load 16 bit code */
- if (read(fd, real_addr, 512) != 512)
- goto fail;
- setup_sects = real_addr[0x1F1];
- if (!setup_sects)
- setup_sects = 4;
- if (read(fd, real_addr + 512, setup_sects * 512) !=
- setup_sects * 512)
- goto fail;
-
- /* load 32 bit code */
- size = read(fd, addr, 16 * 1024 * 1024);
- if (size < 0)
- goto fail;
- close(fd);
- return size;
- fail:
- close(fd);
- return -1;
-}
-
static long get_file_size(FILE *f)
{
long where, size;