2 * QEMU PC System Emulator
4 * Copyright (c) 2003-2004 Fabrice Bellard
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
26 /* output Bochs bios info messages */
29 #define BIOS_FILENAME "bios.bin"
30 #define VGABIOS_FILENAME "vgabios.bin"
31 #define VGABIOS_CIRRUS_FILENAME "vgabios-cirrus.bin"
32 #define LINUX_BOOT_FILENAME "linux_boot.bin"
34 #define KERNEL_LOAD_ADDR 0x00100000
35 #define MAX_INITRD_LOAD_ADDR 0x38000000
36 #define KERNEL_PARAMS_ADDR 0x00090000
37 #define KERNEL_CMDLINE_ADDR 0x00099000
38 /* Leave a chunk of memory at the top of RAM for the BIOS ACPI tables. */
39 #define ACPI_DATA_SIZE 0x10000
41 static fdctrl_t
*floppy_controller
;
42 static RTCState
*rtc_state
;
44 static IOAPICState
*ioapic
;
45 static PCIDevice
*i440fx_state
;
47 static void ioport80_write(void *opaque
, uint32_t addr
, uint32_t data
)
51 /* MSDOS compatibility mode FPU exception support */
52 static qemu_irq ferr_irq
;
53 /* XXX: add IGNNE support */
54 void cpu_set_ferr(CPUX86State
*s
)
56 qemu_irq_raise(ferr_irq
);
59 static void ioportF0_write(void *opaque
, uint32_t addr
, uint32_t data
)
61 qemu_irq_lower(ferr_irq
);
65 uint64_t cpu_get_tsc(CPUX86State
*env
)
67 /* Note: when using kqemu, it is more logical to return the host TSC
68 because kqemu does not trap the RDTSC instruction for
69 performance reasons */
71 if (env
->kqemu_enabled
) {
72 return cpu_get_real_ticks();
76 return cpu_get_ticks();
81 void cpu_smm_update(CPUState
*env
)
83 if (i440fx_state
&& env
== first_cpu
)
84 i440fx_set_smm(i440fx_state
, (env
->hflags
>> HF_SMM_SHIFT
) & 1);
89 int cpu_get_pic_interrupt(CPUState
*env
)
93 intno
= apic_get_interrupt(env
);
95 /* set irq request if a PIC irq is still pending */
96 /* XXX: improve that */
97 pic_update_irq(isa_pic
);
100 /* read the irq from the PIC */
101 intno
= pic_read_irq(isa_pic
);
105 static void pic_irq_request(void *opaque
, int irq
, int level
)
107 CPUState
*env
= opaque
;
109 cpu_interrupt(env
, CPU_INTERRUPT_HARD
);
111 cpu_reset_interrupt(env
, CPU_INTERRUPT_HARD
);
114 /* PC cmos mappings */
116 #define REG_EQUIPMENT_BYTE 0x14
118 static int cmos_get_fd_drive_type(int fd0
)
124 /* 1.44 Mb 3"5 drive */
128 /* 2.88 Mb 3"5 drive */
132 /* 1.2 Mb 5"5 drive */
142 static void cmos_init_hd(int type_ofs
, int info_ofs
, BlockDriverState
*hd
)
144 RTCState
*s
= rtc_state
;
145 int cylinders
, heads
, sectors
;
146 bdrv_get_geometry_hint(hd
, &cylinders
, &heads
, §ors
);
147 rtc_set_memory(s
, type_ofs
, 47);
148 rtc_set_memory(s
, info_ofs
, cylinders
);
149 rtc_set_memory(s
, info_ofs
+ 1, cylinders
>> 8);
150 rtc_set_memory(s
, info_ofs
+ 2, heads
);
151 rtc_set_memory(s
, info_ofs
+ 3, 0xff);
152 rtc_set_memory(s
, info_ofs
+ 4, 0xff);
153 rtc_set_memory(s
, info_ofs
+ 5, 0xc0 | ((heads
> 8) << 3));
154 rtc_set_memory(s
, info_ofs
+ 6, cylinders
);
155 rtc_set_memory(s
, info_ofs
+ 7, cylinders
>> 8);
156 rtc_set_memory(s
, info_ofs
+ 8, sectors
);
159 /* hd_table must contain 4 block drivers */
160 static void cmos_init(int ram_size
, int boot_device
, BlockDriverState
**hd_table
)
162 RTCState
*s
= rtc_state
;
167 /* various important CMOS locations needed by PC/Bochs bios */
170 val
= 640; /* base memory in K */
171 rtc_set_memory(s
, 0x15, val
);
172 rtc_set_memory(s
, 0x16, val
>> 8);
174 val
= (ram_size
/ 1024) - 1024;
177 rtc_set_memory(s
, 0x17, val
);
178 rtc_set_memory(s
, 0x18, val
>> 8);
179 rtc_set_memory(s
, 0x30, val
);
180 rtc_set_memory(s
, 0x31, val
>> 8);
182 if (ram_size
> (16 * 1024 * 1024))
183 val
= (ram_size
/ 65536) - ((16 * 1024 * 1024) / 65536);
188 rtc_set_memory(s
, 0x34, val
);
189 rtc_set_memory(s
, 0x35, val
>> 8);
191 switch(boot_device
) {
194 rtc_set_memory(s
, 0x3d, 0x01); /* floppy boot */
196 rtc_set_memory(s
, 0x38, 0x01); /* disable signature check */
200 rtc_set_memory(s
, 0x3d, 0x02); /* hard drive boot */
203 rtc_set_memory(s
, 0x3d, 0x03); /* CD-ROM boot */
209 fd0
= fdctrl_get_drive_type(floppy_controller
, 0);
210 fd1
= fdctrl_get_drive_type(floppy_controller
, 1);
212 val
= (cmos_get_fd_drive_type(fd0
) << 4) | cmos_get_fd_drive_type(fd1
);
213 rtc_set_memory(s
, 0x10, val
);
225 val
|= 0x01; /* 1 drive, ready for boot */
228 val
|= 0x41; /* 2 drives, ready for boot */
231 val
|= 0x02; /* FPU is there */
232 val
|= 0x04; /* PS/2 mouse installed */
233 rtc_set_memory(s
, REG_EQUIPMENT_BYTE
, val
);
237 rtc_set_memory(s
, 0x12, (hd_table
[0] ? 0xf0 : 0) | (hd_table
[1] ? 0x0f : 0));
239 cmos_init_hd(0x19, 0x1b, hd_table
[0]);
241 cmos_init_hd(0x1a, 0x24, hd_table
[1]);
244 for (i
= 0; i
< 4; i
++) {
246 int cylinders
, heads
, sectors
, translation
;
247 /* NOTE: bdrv_get_geometry_hint() returns the physical
248 geometry. It is always such that: 1 <= sects <= 63, 1
249 <= heads <= 16, 1 <= cylinders <= 16383. The BIOS
250 geometry can be different if a translation is done. */
251 translation
= bdrv_get_translation_hint(hd_table
[i
]);
252 if (translation
== BIOS_ATA_TRANSLATION_AUTO
) {
253 bdrv_get_geometry_hint(hd_table
[i
], &cylinders
, &heads
, §ors
);
254 if (cylinders
<= 1024 && heads
<= 16 && sectors
<= 63) {
255 /* No translation. */
258 /* LBA translation. */
264 val
|= translation
<< (i
* 2);
267 rtc_set_memory(s
, 0x39, val
);
270 void ioport_set_a20(int enable
)
272 /* XXX: send to all CPUs ? */
273 cpu_x86_set_a20(first_cpu
, enable
);
276 int ioport_get_a20(void)
278 return ((first_cpu
->a20_mask
>> 20) & 1);
281 static void ioport92_write(void *opaque
, uint32_t addr
, uint32_t val
)
283 ioport_set_a20((val
>> 1) & 1);
284 /* XXX: bit 0 is fast reset */
287 static uint32_t ioport92_read(void *opaque
, uint32_t addr
)
289 return ioport_get_a20() << 1;
292 /***********************************************************/
293 /* Bochs BIOS debug ports */
295 void bochs_bios_write(void *opaque
, uint32_t addr
, uint32_t val
)
297 static const char shutdown_str
[8] = "Shutdown";
298 static int shutdown_index
= 0;
301 /* Bochs BIOS messages */
304 fprintf(stderr
, "BIOS panic at rombios.c, line %d\n", val
);
309 fprintf(stderr
, "%c", val
);
313 /* same as Bochs power off */
314 if (val
== shutdown_str
[shutdown_index
]) {
316 if (shutdown_index
== 8) {
318 qemu_system_shutdown_request();
325 /* LGPL'ed VGA BIOS messages */
328 fprintf(stderr
, "VGA BIOS panic, line %d\n", val
);
333 fprintf(stderr
, "%c", val
);
339 void bochs_bios_init(void)
341 register_ioport_write(0x400, 1, 2, bochs_bios_write
, NULL
);
342 register_ioport_write(0x401, 1, 2, bochs_bios_write
, NULL
);
343 register_ioport_write(0x402, 1, 1, bochs_bios_write
, NULL
);
344 register_ioport_write(0x403, 1, 1, bochs_bios_write
, NULL
);
345 register_ioport_write(0x8900, 1, 1, bochs_bios_write
, NULL
);
347 register_ioport_write(0x501, 1, 2, bochs_bios_write
, NULL
);
348 register_ioport_write(0x502, 1, 2, bochs_bios_write
, NULL
);
349 register_ioport_write(0x500, 1, 1, bochs_bios_write
, NULL
);
350 register_ioport_write(0x503, 1, 1, bochs_bios_write
, NULL
);
354 int load_kernel(const char *filename
, uint8_t *addr
,
360 fd
= open(filename
, O_RDONLY
| O_BINARY
);
364 /* load 16 bit code */
365 if (read(fd
, real_addr
, 512) != 512)
367 setup_sects
= real_addr
[0x1F1];
370 if (read(fd
, real_addr
+ 512, setup_sects
* 512) !=
374 /* load 32 bit code */
375 size
= read(fd
, addr
, 16 * 1024 * 1024);
385 static void main_cpu_reset(void *opaque
)
387 CPUState
*env
= opaque
;
391 static const int ide_iobase
[2] = { 0x1f0, 0x170 };
392 static const int ide_iobase2
[2] = { 0x3f6, 0x376 };
393 static const int ide_irq
[2] = { 14, 15 };
395 #define NE2000_NB_MAX 6
397 static int ne2000_io
[NE2000_NB_MAX
] = { 0x300, 0x320, 0x340, 0x360, 0x280, 0x380 };
398 static int ne2000_irq
[NE2000_NB_MAX
] = { 9, 10, 11, 3, 4, 5 };
400 static int serial_io
[MAX_SERIAL_PORTS
] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 };
401 static int serial_irq
[MAX_SERIAL_PORTS
] = { 4, 3, 4, 3 };
403 static int parallel_io
[MAX_PARALLEL_PORTS
] = { 0x378, 0x278, 0x3bc };
404 static int parallel_irq
[MAX_PARALLEL_PORTS
] = { 7, 7, 7 };
407 static void audio_init (PCIBus
*pci_bus
, qemu_irq
*pic
)
410 int audio_enabled
= 0;
412 for (c
= soundhw
; !audio_enabled
&& c
->name
; ++c
) {
413 audio_enabled
= c
->enabled
;
421 for (c
= soundhw
; c
->name
; ++c
) {
424 c
->init
.init_isa (s
, pic
);
428 c
->init
.init_pci (pci_bus
, s
);
438 static void pc_init_ne2k_isa(NICInfo
*nd
, qemu_irq
*pic
)
440 static int nb_ne2k
= 0;
442 if (nb_ne2k
== NE2000_NB_MAX
)
444 isa_ne2000_init(ne2000_io
[nb_ne2k
], pic
[ne2000_irq
[nb_ne2k
]], nd
);
448 /* PC hardware initialisation */
449 static void pc_init1(int ram_size
, int vga_ram_size
, int boot_device
,
450 DisplayState
*ds
, const char **fd_filename
, int snapshot
,
451 const char *kernel_filename
, const char *kernel_cmdline
,
452 const char *initrd_filename
,
456 int ret
, linux_boot
, initrd_size
, i
;
457 ram_addr_t ram_addr
, vga_ram_addr
, bios_offset
, vga_bios_offset
;
458 ram_addr_t initrd_offset
;
459 int bios_size
, isa_bios_size
, vga_bios_size
;
461 int piix3_devfn
= -1;
467 linux_boot
= (kernel_filename
!= NULL
);
470 for(i
= 0; i
< smp_cpus
; i
++) {
473 env
->hflags
|= HF_HALTED_MASK
;
475 /* XXX: enable it in all cases */
476 env
->cpuid_features
|= CPUID_APIC
;
478 register_savevm("cpu", i
, 4, cpu_save
, cpu_load
, env
);
479 qemu_register_reset(main_cpu_reset
, env
);
486 ram_addr
= qemu_ram_alloc(ram_size
);
487 cpu_register_physical_memory(0, ram_size
, ram_addr
);
489 /* allocate VGA RAM */
490 vga_ram_addr
= qemu_ram_alloc(vga_ram_size
);
493 snprintf(buf
, sizeof(buf
), "%s/%s", bios_dir
, BIOS_FILENAME
);
494 bios_size
= get_image_size(buf
);
495 if (bios_size
<= 0 ||
496 (bios_size
% 65536) != 0) {
499 bios_offset
= qemu_ram_alloc(bios_size
);
500 ret
= load_image(buf
, phys_ram_base
+ bios_offset
);
501 if (ret
!= bios_size
) {
503 fprintf(stderr
, "qemu: could not load PC BIOS '%s'\n", buf
);
508 if (cirrus_vga_enabled
) {
509 snprintf(buf
, sizeof(buf
), "%s/%s", bios_dir
, VGABIOS_CIRRUS_FILENAME
);
511 snprintf(buf
, sizeof(buf
), "%s/%s", bios_dir
, VGABIOS_FILENAME
);
513 vga_bios_size
= get_image_size(buf
);
514 if (vga_bios_size
<= 0 || vga_bios_size
> 65536)
516 vga_bios_offset
= qemu_ram_alloc(65536);
518 ret
= load_image(buf
, phys_ram_base
+ vga_bios_offset
);
519 if (ret
!= vga_bios_size
) {
521 fprintf(stderr
, "qemu: could not load VGA BIOS '%s'\n", buf
);
525 /* setup basic memory access */
526 cpu_register_physical_memory(0xc0000, 0x10000,
527 vga_bios_offset
| IO_MEM_ROM
);
529 /* map the last 128KB of the BIOS in ISA space */
530 isa_bios_size
= bios_size
;
531 if (isa_bios_size
> (128 * 1024))
532 isa_bios_size
= 128 * 1024;
533 cpu_register_physical_memory(0xd0000, (192 * 1024) - isa_bios_size
,
535 cpu_register_physical_memory(0x100000 - isa_bios_size
,
537 (bios_offset
+ bios_size
- isa_bios_size
) | IO_MEM_ROM
);
540 ram_addr_t option_rom_offset
;
544 for (i
= 0; i
< nb_option_roms
; i
++) {
545 size
= get_image_size(option_rom
[i
]);
547 fprintf(stderr
, "Could not load option rom '%s'\n",
551 if (size
> (0x10000 - offset
))
552 goto option_rom_error
;
553 option_rom_offset
= qemu_ram_alloc(size
);
554 ret
= load_image(option_rom
[i
], phys_ram_base
+ option_rom_offset
);
557 fprintf(stderr
, "Too many option ROMS\n");
560 size
= (size
+ 4095) & ~4095;
561 cpu_register_physical_memory(0xd0000 + offset
,
562 size
, option_rom_offset
| IO_MEM_ROM
);
567 /* map all the bios at the top of memory */
568 cpu_register_physical_memory((uint32_t)(-bios_size
),
569 bios_size
, bios_offset
| IO_MEM_ROM
);
574 uint8_t bootsect
[512];
575 uint8_t old_bootsect
[512];
577 if (bs_table
[0] == NULL
) {
578 fprintf(stderr
, "A disk image must be given for 'hda' when booting a Linux kernel\n");
581 snprintf(buf
, sizeof(buf
), "%s/%s", bios_dir
, LINUX_BOOT_FILENAME
);
582 ret
= load_image(buf
, bootsect
);
583 if (ret
!= sizeof(bootsect
)) {
584 fprintf(stderr
, "qemu: could not load linux boot sector '%s'\n",
589 if (bdrv_read(bs_table
[0], 0, old_bootsect
, 1) >= 0) {
590 /* copy the MSDOS partition table */
591 memcpy(bootsect
+ 0x1be, old_bootsect
+ 0x1be, 0x40);
594 bdrv_set_boot_sector(bs_table
[0], bootsect
, sizeof(bootsect
));
596 /* now we can load the kernel */
597 ret
= load_kernel(kernel_filename
,
598 phys_ram_base
+ KERNEL_LOAD_ADDR
,
599 phys_ram_base
+ KERNEL_PARAMS_ADDR
);
601 fprintf(stderr
, "qemu: could not load kernel '%s'\n",
609 if (initrd_filename
) {
610 initrd_size
= get_image_size (initrd_filename
);
611 if (initrd_size
> 0) {
612 initrd_offset
= (ram_size
- initrd_size
) & TARGET_PAGE_MASK
;
613 /* Leave space for BIOS ACPI tables. */
614 initrd_offset
-= ACPI_DATA_SIZE
;
615 /* Avoid the last 64k to avoid 2.2.x kernel bugs. */
616 initrd_offset
-= 0x10000;
617 if (initrd_offset
> MAX_INITRD_LOAD_ADDR
)
618 initrd_offset
= MAX_INITRD_LOAD_ADDR
;
620 if (initrd_size
> ram_size
621 || initrd_offset
< KERNEL_LOAD_ADDR
+ ret
) {
623 "qemu: memory too small for initial ram disk '%s'\n",
627 initrd_size
= load_image(initrd_filename
,
628 phys_ram_base
+ initrd_offset
);
630 if (initrd_size
< 0) {
631 fprintf(stderr
, "qemu: could not load initial ram disk '%s'\n",
636 if (initrd_size
> 0) {
637 stl_raw(phys_ram_base
+ KERNEL_PARAMS_ADDR
+ 0x218, initrd_offset
);
638 stl_raw(phys_ram_base
+ KERNEL_PARAMS_ADDR
+ 0x21c, initrd_size
);
640 pstrcpy(phys_ram_base
+ KERNEL_CMDLINE_ADDR
, 4096,
642 stw_raw(phys_ram_base
+ KERNEL_PARAMS_ADDR
+ 0x20, 0xA33F);
643 stw_raw(phys_ram_base
+ KERNEL_PARAMS_ADDR
+ 0x22,
644 KERNEL_CMDLINE_ADDR
- KERNEL_PARAMS_ADDR
);
646 stw_raw(phys_ram_base
+ KERNEL_PARAMS_ADDR
+ 0x210, 0x01);
649 cpu_irq
= qemu_allocate_irqs(pic_irq_request
, first_cpu
, 1);
650 i8259
= i8259_init(cpu_irq
[0]);
651 ferr_irq
= i8259
[13];
654 pci_bus
= i440fx_init(&i440fx_state
, i8259
);
655 piix3_devfn
= piix3_init(pci_bus
, -1);
660 /* init basic PC hardware */
661 register_ioport_write(0x80, 1, 1, ioport80_write
, NULL
);
663 register_ioport_write(0xf0, 1, 1, ioportF0_write
, NULL
);
665 if (cirrus_vga_enabled
) {
667 pci_cirrus_vga_init(pci_bus
,
668 ds
, phys_ram_base
+ vga_ram_addr
,
669 vga_ram_addr
, vga_ram_size
);
671 isa_cirrus_vga_init(ds
, phys_ram_base
+ vga_ram_addr
,
672 vga_ram_addr
, vga_ram_size
);
674 } else if (vmsvga_enabled
) {
676 pci_vmsvga_init(pci_bus
, ds
, phys_ram_base
+ ram_size
,
677 ram_size
, vga_ram_size
);
679 fprintf(stderr
, "%s: vmware_vga: no PCI bus\n", __FUNCTION__
);
682 pci_vga_init(pci_bus
, ds
, phys_ram_base
+ vga_ram_addr
,
683 vga_ram_addr
, vga_ram_size
, 0, 0);
685 isa_vga_init(ds
, phys_ram_base
+ vga_ram_addr
,
686 vga_ram_addr
, vga_ram_size
);
690 rtc_state
= rtc_init(0x70, i8259
[8]);
692 register_ioport_read(0x92, 1, 1, ioport92_read
, NULL
);
693 register_ioport_write(0x92, 1, 1, ioport92_write
, NULL
);
696 ioapic
= ioapic_init();
698 pit
= pit_init(0x40, i8259
[0]);
701 pic_set_alt_irq_func(isa_pic
, ioapic_set_irq
, ioapic
);
704 for(i
= 0; i
< MAX_SERIAL_PORTS
; i
++) {
706 serial_init(serial_io
[i
], i8259
[serial_irq
[i
]], serial_hds
[i
]);
710 for(i
= 0; i
< MAX_PARALLEL_PORTS
; i
++) {
711 if (parallel_hds
[i
]) {
712 parallel_init(parallel_io
[i
], i8259
[parallel_irq
[i
]],
717 for(i
= 0; i
< nb_nics
; i
++) {
721 nd
->model
= "ne2k_pci";
723 nd
->model
= "ne2k_isa";
726 if (strcmp(nd
->model
, "ne2k_isa") == 0) {
727 pc_init_ne2k_isa(nd
, i8259
);
728 } else if (pci_enabled
) {
729 pci_nic_init(pci_bus
, nd
, -1);
731 fprintf(stderr
, "qemu: Unsupported NIC: %s\n", nd
->model
);
737 pci_piix3_ide_init(pci_bus
, bs_table
, piix3_devfn
+ 1, i8259
);
739 for(i
= 0; i
< 2; i
++) {
740 isa_ide_init(ide_iobase
[i
], ide_iobase2
[i
], i8259
[ide_irq
[i
]],
741 bs_table
[2 * i
], bs_table
[2 * i
+ 1]);
745 i8042_init(i8259
[1], i8259
[12], 0x60);
748 audio_init(pci_enabled
? pci_bus
: NULL
, i8259
);
751 floppy_controller
= fdctrl_init(i8259
[6], 2, 0, 0x3f0, fd_table
);
753 cmos_init(ram_size
, boot_device
, bs_table
);
755 if (pci_enabled
&& usb_enabled
) {
756 usb_uhci_init(pci_bus
, piix3_devfn
+ 2);
759 if (pci_enabled
&& acpi_enabled
) {
760 uint8_t *eeprom_buf
= qemu_mallocz(8 * 256); /* XXX: make this persistent */
761 piix4_pm_init(pci_bus
, piix3_devfn
+ 3);
762 for (i
= 0; i
< 8; i
++) {
763 SMBusDevice
*eeprom
= smbus_eeprom_device_init(0x50 + i
,
764 eeprom_buf
+ (i
* 256));
765 piix4_smbus_register_device(eeprom
, 0x50 + i
);
770 i440fx_init_memory_mappings(i440fx_state
);
773 /* ??? Need to figure out some way for the user to
774 specify SCSI devices. */
777 BlockDriverState
*bdrv
;
779 scsi
= lsi_scsi_init(pci_bus
, -1);
780 bdrv
= bdrv_new("scsidisk");
781 bdrv_open(bdrv
, "scsi_disk.img", 0);
782 lsi_scsi_attach(scsi
, bdrv
, -1);
783 bdrv
= bdrv_new("scsicd");
784 bdrv_open(bdrv
, "scsi_cd.iso", 0);
785 bdrv_set_type_hint(bdrv
, BDRV_TYPE_CDROM
);
786 lsi_scsi_attach(scsi
, bdrv
, -1);
791 static void pc_init_pci(int ram_size
, int vga_ram_size
, int boot_device
,
792 DisplayState
*ds
, const char **fd_filename
,
794 const char *kernel_filename
,
795 const char *kernel_cmdline
,
796 const char *initrd_filename
,
797 const char *cpu_model
)
799 pc_init1(ram_size
, vga_ram_size
, boot_device
,
800 ds
, fd_filename
, snapshot
,
801 kernel_filename
, kernel_cmdline
,
805 static void pc_init_isa(int ram_size
, int vga_ram_size
, int boot_device
,
806 DisplayState
*ds
, const char **fd_filename
,
808 const char *kernel_filename
,
809 const char *kernel_cmdline
,
810 const char *initrd_filename
,
811 const char *cpu_model
)
813 pc_init1(ram_size
, vga_ram_size
, boot_device
,
814 ds
, fd_filename
, snapshot
,
815 kernel_filename
, kernel_cmdline
,
819 QEMUMachine pc_machine
= {
825 QEMUMachine isapc_machine
= {