Commit ddc2db503dd374ae0355dfd5d0dcb60aa5ec47ac
1 parent
942ac052
x86: remove load_kernel()
(Jan Kiszka) git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4233 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
0 additions
and
31 deletions
hw/pc.c
| @@ -445,37 +445,6 @@ static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip) | @@ -445,37 +445,6 @@ static void generate_bootsect(uint32_t gpr[8], uint16_t segs[6], uint16_t ip) | ||
| 445 | bdrv_set_boot_sector(drives_table[hda].bdrv, bootsect, sizeof(bootsect)); | 445 | bdrv_set_boot_sector(drives_table[hda].bdrv, bootsect, sizeof(bootsect)); |
| 446 | } | 446 | } |
| 447 | 447 | ||
| 448 | -static int load_kernel(const char *filename, uint8_t *addr, | ||
| 449 | - uint8_t *real_addr) | ||
| 450 | -{ | ||
| 451 | - int fd, size; | ||
| 452 | - int setup_sects; | ||
| 453 | - | ||
| 454 | - fd = open(filename, O_RDONLY | O_BINARY); | ||
| 455 | - if (fd < 0) | ||
| 456 | - return -1; | ||
| 457 | - | ||
| 458 | - /* load 16 bit code */ | ||
| 459 | - if (read(fd, real_addr, 512) != 512) | ||
| 460 | - goto fail; | ||
| 461 | - setup_sects = real_addr[0x1F1]; | ||
| 462 | - if (!setup_sects) | ||
| 463 | - setup_sects = 4; | ||
| 464 | - if (read(fd, real_addr + 512, setup_sects * 512) != | ||
| 465 | - setup_sects * 512) | ||
| 466 | - goto fail; | ||
| 467 | - | ||
| 468 | - /* load 32 bit code */ | ||
| 469 | - size = read(fd, addr, 16 * 1024 * 1024); | ||
| 470 | - if (size < 0) | ||
| 471 | - goto fail; | ||
| 472 | - close(fd); | ||
| 473 | - return size; | ||
| 474 | - fail: | ||
| 475 | - close(fd); | ||
| 476 | - return -1; | ||
| 477 | -} | ||
| 478 | - | ||
| 479 | static long get_file_size(FILE *f) | 448 | static long get_file_size(FILE *f) |
| 480 | { | 449 | { |
| 481 | long where, size; | 450 | long where, size; |