unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Xen hypervisor
@ 2020-11-26 11:33 Danny Milosavljevic
  2020-11-26 12:51 ` Jan Nieuwenhuizen
  0 siblings, 1 reply; 2+ messages in thread
From: Danny Milosavljevic @ 2020-11-26 11:33 UTC (permalink / raw)
  To: guix-devel, Jan Nieuwenhuizen

[-- Attachment #1: Type: text/plain, Size: 1774 bytes --]

Hi Janneke,

with our (gnu bootloader grub) already supporting multiboot, it would be easy
for us to add official support for the Xen hypervisor & Linux.

I've already packaged xen and it's ready to be used.

In order to boot Xen, the grub config should read something like this:

menuentry 'Guix with Xen Hypervisor' --class gnu-linux --class gnu --class os --class xen {
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root c4291ab1-d3ad-4c70-ab97-e6c8cca0af2b
        echo    'Loading Xen 4.1-amd64 ...'
        multiboot       /xen-4.1-amd64.gz placeholder  
        echo    'Loading Linux 3.10-3-amd64 ...'
        module  /vmlinuz-3.10-3-amd64 placeholder root=/dev/mapper/disks-root ro resume=/dev/mapper/disks-swap quiet
        echo    'Loading initial ramdisk ...'
        module  /initrd.img-3.10-3-amd64
}

Note especially that "multiboot" is "/xen-4.1-amd64.gz", and that "module"
statements are used for the linux kernel and for the initrd.

The work you have been doing for the Hurd already fetches both the "multiboot"
and the "module" parameters from the boot-parameters via
boot-parameters->menu-entry.

But I can't find how I can set the multiboot-modules in my operating-system
definition.

Like,

(operating-system
  (kernel (file-append xen "/boot/xen.gz"))
  (multiboot-modules (list linux-libre initrd)))

(Or find where it is set for the Hurd in the first place)

Also, how do I get guix's usual initrd into that multiboot-modules list ?

Do you think it would make sense to adapt boot-parameters->menu-entry
slightly so one could specify both a multiboot kernel and a linux kernel
at the same time?  Or would that be too magical?

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Xen hypervisor
  2020-11-26 11:33 Xen hypervisor Danny Milosavljevic
@ 2020-11-26 12:51 ` Jan Nieuwenhuizen
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Nieuwenhuizen @ 2020-11-26 12:51 UTC (permalink / raw)
  To: Danny Milosavljevic; +Cc: guix-devel

Danny Milosavljevic writes:

> Hi Janneke,
>
> with our (gnu bootloader grub) already supporting multiboot, it would be easy
> for us to add official support for the Xen hypervisor & Linux.
>
> I've already packaged xen and it's ready to be used.
>
> In order to boot Xen, the grub config should read something like this:

Nice; this could help a lot with hurd work, notably 64bit/x86_64 and SMP
work, IIUC.

> Note especially that "multiboot" is "/xen-4.1-amd64.gz", and that "module"
> statements are used for the linux kernel and for the initrd.

OK.

> The work you have been doing for the Hurd already fetches both the "multiboot"
> and the "module" parameters from the boot-parameters via
> boot-parameters->menu-entry.
>
> But I can't find how I can set the multiboot-modules in my operating-system
> definition.

Yes,..currently, you only can if you're "hurd":

gnu/system.scm has:
--8<---------------cut here---------------start------------->8---
(define (boot-parameters->menu-entry conf)
  (let* ((kernel (boot-parameters-kernel conf))
         (multiboot-modules (boot-parameters-multiboot-modules conf))
         (multiboot? (pair? multiboot-modules)))
--8<---------------cut here---------------end--------------->8---

and

--8<---------------cut here---------------start------------->8---
(define (operating-system-multiboot-modules os)
  (if (operating-system-hurd os) (hurd-multiboot-modules os) '()))
--8<---------------cut here---------------end--------------->8---

> Like,
>
> (operating-system
>   (kernel (file-append xen "/boot/xen.gz"))
>   (multiboot-modules (list linux-libre initrd)))

Yes, we need some an indirection.  There already is

--8<---------------cut here---------------start------------->8---
(define (hurd-multiboot-modules os)
  (let* ((hurd (operating-system-hurd os))
         (root-file-system-command
          (list (file-append hurd "/hurd/ext2fs.static")
                "ext2fs"
                "--multiboot-command-line='${kernel-command-line}'"
                "--host-priv-port='${host-port}'"
                "--device-master-port='${device-port}'"
                "--exec-server-task='${exec-task}'"
                "--store-type=typed"
                "--x-xattr-translator-records"
                "'${root}'" "'$(task-create)'" "'$(task-resume)'"))
...
--8<---------------cut here---------------end--------------->8---

> Also, how do I get guix's usual initrd into that multiboot-modules list ?

Yes, that's another thing that would need to change, if you look at

gnu/bootloader/grub.scm has:
--8<---------------cut here---------------start------------->8---
(define* (grub-configuration-file config entries
...
      (if linux
          (let ((arguments (menu-entry-linux-arguments entry))
          ...
          (let ((kernel (menu-entry-multiboot-kernel entry))
          ...
--8<---------------cut here---------------end--------------->8---

we don't do multiboot when we're doing linux.

> Do you think it would make sense to adapt boot-parameters->menu-entry
> slightly so one could specify both a multiboot kernel and a linux kernel
> at the same time?  Or would that be too magical?

Hmm, I'd have to see the patch ;-)  We need a parameterisation, not sure
if splitting case LINUX in two is preferrable over a third flavor.

HTH!

Greetings,
Janneke

-- 
Jan Nieuwenhuizen <janneke@gnu.org> | GNU LilyPond http://lilypond.org
Freelance IT http://JoyofSource.com | Avatar® http://AvatarAcademy.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-11-26 12:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-26 11:33 Xen hypervisor Danny Milosavljevic
2020-11-26 12:51 ` Jan Nieuwenhuizen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).