Skip to contentSkip to conversation

x86: remove load_kernel

PATCH New Jan Kiszka 1 participant 1 message Apr 15, 2008

lore
Share & tools
lore

Jan Kiszka

author
#0 lore raw

PATCH 1/1 x86: remove load_kernel

What is the point of the unused load_kernel() in hw/pc.c? Can't it simply be removed (to reduce the warning noise a bit)?

---
 hw/pc.c |   31 -------------------------------
 1 file changed, 31 deletions(-)
hw/pc.c +0 -31
Index: b/hw/pc.c
===================================================================
@@ -445,37 +445,6 @@ static void generate_bootsect(uint32_t g
     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;