Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Anthony Liguori
Nguyen Anh Quynh wrote: >> >> The thinking is to eliminate the need to hijack the boot sector when using >> the -kernel option. >> > > I see, but does that offer any advantage over the current approach? > You no longer have to specify a -hda option when using -kernel. Regards, Anthony L

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Anthony Liguori
Nguyen Anh Quynh wrote: >> You no longer have to specify a -hda option when using -kernel. >> > > Without -hda, how can we load disk image? Or you mean you only want to > test the kernel? > Right. You may be booting from NFS, iSCSI, or something like that. Regards, Anthony Liguori > T

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Nguyen Anh Quynh
On 4/18/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > Nguyen Anh Quynh wrote: > > > > > > > > > The thinking is to eliminate the need to hijack the boot sector when > using > > > the -kernel option. > > > > > > > > > > I see, but does that offer any advantage over the current approach? > > > >

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread H. Peter Anvin
Anthony Liguori wrote: > Nguyen Anh Quynh wrote: >>> >>> The thinking is to eliminate the need to hijack the boot sector when >>> using >>> the -kernel option. >>> >> >> I see, but does that offer any advantage over the current approach? >> > > You no longer have to specify a -hda option

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Nguyen Anh Quynh
On 4/18/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > Nguyen Anh Quynh wrote: > > > On Thu, Apr 17, 2008 at 3:00 PM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > > > > > > > > > > > + .globl linux_boot > > > > +linux_boot: > > > > + cli > > > > + cld > > > > + mov $0x9000,

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread H. Peter Anvin
Anthony Liguori wrote: > > The thinking is to eliminate the need to hijack the boot sector when > using the -kernel option. However, the linux boot stuff in extboot has > been broken since hpa rewrote the boot code. It can be removed for now > and I'll eventually revisit it. > It probably m

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Anthony Liguori
H. Peter Anvin wrote: > Nguyen Anh Quynh wrote: >> >> Actually, this code is left from the original code of Anthony, and it >> seems he took it from qemu 0.8 version. >> >> Anthony, may you explain why you want to hijact the linux boot process >> here? If I understand correctly, we can just let the

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Anthony Liguori
Nguyen Anh Quynh wrote: > On Thu, Apr 17, 2008 at 3:00 PM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > >>> + .globl linux_boot >>> +linux_boot: >>> + cli >>> + cld >>> + mov $0x9000, %ax >>> + mov %ax, %ds >>> + mov %ax, %es >>> + mov %ax, %fs >>> +

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread H. Peter Anvin
Nguyen Anh Quynh wrote: > > Actually, this code is left from the original code of Anthony, and it > seems he took it from qemu 0.8 version. > > Anthony, may you explain why you want to hijact the linux boot process > here? If I understand correctly, we can just let the original int19 > execute, a

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread H. Peter Anvin
Nguyen Anh Quynh wrote: > > Actually, this code is left from the original code of Anthony, and it > seems he took it from qemu 0.8 version. > > Anthony, may you explain why you want to hijact the linux boot process > here? If I understand correctly, we can just let the original int19 > execute, a

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Nguyen Anh Quynh
On Thu, Apr 17, 2008 at 4:36 PM, Carlo Marcelo Arenas Belon <[EMAIL PROTECTED]> wrote: > On Thu, Apr 17, 2008 at 10:30:27AM +0900, Nguyen Anh Quynh wrote: > > +++ b/extboot/farvar.h > @@ -0,0 +1,113 @@ > +// Code to access multiple segments within gcc. > +// > +// Copyright (C) 2008 Kevin O'C

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Nguyen Anh Quynh
On Thu, Apr 17, 2008 at 3:00 PM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > > + .globl linux_boot > > +linux_boot: > > + cli > > + cld > > + mov $0x9000, %ax > > + mov %ax, %ds > > + mov %ax, %es > > + mov %ax, %fs > > + mov %ax, %gs > > + mov

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-18 Thread Nguyen Anh Quynh
On Thu, Apr 17, 2008 at 2:58 PM, H. Peter Anvin <[EMAIL PROTECTED]> wrote: > Nguyen Anh Quynh wrote: > > > This patch replaces the current assembly code of Extboot option rom > > with new C code. Patch is against kvm-66. > > > > This version returns an error code in case int 13 handler cannot > > h

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-17 Thread Carlo Marcelo Arenas Belon
On Thu, Apr 17, 2008 at 10:30:27AM +0900, Nguyen Anh Quynh wrote: +++ b/extboot/farvar.h @@ -0,0 +1,113 @@ +// Code to access multiple segments within gcc. +// +// Copyright (C) 2008 Kevin O'Connor <[EMAIL PROTECTED]> +// +// This file may be distributed under the terms of the GNU GPLv3 license.

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-16 Thread H. Peter Anvin
> + .globl linux_boot > +linux_boot: > + cli > + cld > + mov $0x9000, %ax > + mov %ax, %ds > + mov %ax, %es > + mov %ax, %fs > + mov %ax, %gs > + mov %ax, %ss > + mov $0x8ffe, %sp > + ljmp $0x9000 + 0x20, $0 The hard use of segment 9000 is really highly

Re: [kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-16 Thread H. Peter Anvin
Nguyen Anh Quynh wrote: > This patch replaces the current assembly code of Extboot option rom > with new C code. Patch is against kvm-66. > > This version returns an error code in case int 13 handler cannot > handle a requested function. > > Signed-off-by: Nguyen Anh Quynh <[EMAIL PROTECTED]> >

[kvm-devel] Extboot Option ROM rewritten in C - v3

2008-04-16 Thread Nguyen Anh Quynh
This patch replaces the current assembly code of Extboot option rom with new C code. Patch is against kvm-66. This version returns an error code in case int 13 handler cannot handle a requested function. Signed-off-by: Nguyen Anh Quynh <[EMAIL PROTECTED]> # diffstat extboot3.diff b/extboot/Mak

Re: [kvm-devel] Extboot Option ROM rewritten in C - v2

2008-04-16 Thread Nguyen Anh Quynh
On Thu, Apr 17, 2008 at 12:02 AM, Anthony Liguori <[EMAIL PROTECTED]> wrote: > A couple general comments. > > I'd feel a lot more comfortable with the int13 handler returning an int and > the asm stub code uses that result to determine how to set CF. You set CF > deep within the function stack an

Re: [kvm-devel] Extboot Option ROM rewritten in C - v2

2008-04-16 Thread Anthony Liguori
A couple general comments. I'd feel a lot more comfortable with the int13 handler returning an int and the asm stub code uses that result to determine how to set CF. You set CF deep within the function stack and there's no guarantee that GCC isn't going to stomp on it. I also don't think we w

Re: [kvm-devel] Extboot Option ROM rewritten in C - v2

2008-04-16 Thread Anthony Liguori
Anthony Liguori wrote: > A couple general comments. > > I'd feel a lot more comfortable with the int13 handler returning an > int and the asm stub code uses that result to determine how to set > CF. You set CF deep within the function stack and there's no > guarantee that GCC isn't going to sto

Re: [kvm-devel] Extboot Option ROM rewritten in C - v2

2008-04-16 Thread Anthony Liguori
Nguyen Anh Quynh wrote: > Hi Anthony, > > I found a bug in the last code: send_command() failed to copy back the > result into extboot_cmd structure. This patch fixes it. > > I succesfully tested this version with guest Win2K (fully updated, > scsi boot) and Linux 2.6.25-rc8 (virtio). > > Let me kn

[kvm-devel] Extboot Option ROM rewritten in C - v2

2008-04-16 Thread Nguyen Anh Quynh
Hi Anthony, I found a bug in the last code: send_command() failed to copy back the result into extboot_cmd structure. This patch fixes it. I succesfully tested this version with guest Win2K (fully updated, scsi boot) and Linux 2.6.25-rc8 (virtio). Let me know if you can boot Windows with this ve

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-15 Thread Anthony Liguori
Nguyen Anh Quynh wrote: > On 4/15/08, Nguyen Anh Quynh <[EMAIL PROTECTED]> wrote: > > >> > You should be able to get very far along the Windows boot process with >> > extboot. If you just install the LSI driver in Win2k, you can boot up >> > completely. Someone just posted instructions for

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-15 Thread Jun Koi
On Tue, Apr 15, 2008 at 12:34 PM, Anthony Liguori <[EMAIL PROTECTED]> wrote: > Nguyen Anh Quynh wrote: > > On 4/15/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > > > >> Hi Nguyen, > >> > >> Nguyen Anh Quynh wrote: > >> > >> > >>> Hi Anthony, > >>> > >>> I spot a bug and few dead code i

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-14 Thread Nguyen Anh Quynh
On 4/15/08, Nguyen Anh Quynh <[EMAIL PROTECTED]> wrote: > > You should be able to get very far along the Windows boot process with > > extboot. If you just install the LSI driver in Win2k, you can boot up > > completely. Someone just posted instructions for doing scsi boot with > > Windows

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-14 Thread Nguyen Anh Quynh
On 4/15/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > Nguyen Anh Quynh wrote: > > > On 4/15/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > > > > > > > Hi Nguyen, > > > > > > Nguyen Anh Quynh wrote: > > > > > > > > > > > > > Hi Anthony, > > > > > > > > I spot a bug and few dead code in the ext

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-14 Thread Anthony Liguori
Nguyen Anh Quynh wrote: > On 4/15/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > >> Hi Nguyen, >> >> Nguyen Anh Quynh wrote: >> >> >>> Hi Anthony, >>> >>> I spot a bug and few dead code in the extboot option rom. Perhaps the >>> reason they are there is because less people want to look a

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-14 Thread Nguyen Anh Quynh
On 4/15/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > Hi Nguyen, > > Nguyen Anh Quynh wrote: > > > Hi Anthony, > > > > I spot a bug and few dead code in the extboot option rom. Perhaps the > > reason they are there is because less people want to look at assembly > > code, and it looks indeed sc

Re: [kvm-devel] Extboot Option Rom rewritten in C

2008-04-14 Thread Anthony Liguori
Hi Nguyen, Nguyen Anh Quynh wrote: > Hi Anthony, > > I spot a bug and few dead code in the extboot option rom. Perhaps the > reason they are there is because less people want to look at assembly > code, and it looks indeed scary. > > So I decided to rewrite it in C, using .code16gcc directive. Som

[kvm-devel] Extboot Option Rom rewritten in C

2008-04-14 Thread Nguyen Anh Quynh
Hi Anthony, I spot a bug and few dead code in the extboot option rom. Perhaps the reason they are there is because less people want to look at assembly code, and it looks indeed scary. So I decided to rewrite it in C, using .code16gcc directive. Some advantages: - C code is easier to understand,