All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Millan <rmh@aybabtu.com>
To: The development of GRUB 2 <grub-devel@gnu.org>
Subject: Re: [PATCH] a.out support for multiboot and freebsd
Date: Mon, 11 Feb 2008 22:28:16 +0100	[thread overview]
Message-ID: <20080211212816.GA1064@thorin> (raw)
In-Reply-To: <ca0f59980802111246v35aadc23s85c0e12910950d6a@mail.gmail.com>

On Tue, Feb 12, 2008 at 04:46:31AM +0800, Bean wrote:
> +# For _freebsd.mod
> +_bsd_mod_SOURCES = loader/i386/pc/bsd.c

You forgot to rename the commend ;-)

> +_bsd_mod_CFLAGS = $(COMMON_CFLAGS)
> +_bsd_mod_LDFLAGS = $(COMMON_LDFLAGS)
> +
> +# For freebsd.mod
> +bsd_mod_SOURCES = loader/i386/pc/bsd_normal.c
> +bsd_mod_CFLAGS = $(COMMON_CFLAGS)
> +bsd_mod_LDFLAGS = $(COMMON_LDFLAGS)

How much pc-dependant are those?  Can we hope they will work in e.g.
i386-coreboot in the future, when *BSD kernels remove their BIOS
dependency?

> +#define FREEBSD_RB_ASKNAME	0x1	/* ask for file name to reboot from */
> +#define FREEBSD_RB_SINGLE       0x2	/* reboot to single user only */
> +#define FREEBSD_RB_NOSYNC       0x4	/* dont sync before reboot */
> +#define FREEBSD_RB_HALT         0x8	/* don't reboot, just halt */
> +#define FREEBSD_RB_INITNAME     0x10	/* name given for /etc/init (unused) */
> +#define FREEBSD_RB_DFLTROOT     0x20	/* use compiled-in rootdev */
> +#define FREEBSD_RB_KDB          0x40	/* give control to kernel debugger */
> +#define FREEBSD_RB_RDONLY       0x80	/* mount root fs read-only */
> +#define FREEBSD_RB_DUMP         0x100	/* dump kernel memory before reboot */
> +#define FREEBSD_RB_MINIROOT     0x200	/* mini-root present in memory at boot time */
> +#define FREEBSD_RB_CONFIG       0x400	/* invoke user configuration routing */
> +#define FREEBSD_RB_VERBOSE      0x800	/* print all potentially useful info */
> +#define FREEBSD_RB_SERIAL       0x1000	/* user serial port as console */
> +#define FREEBSD_RB_CDROM        0x2000	/* use cdrom as root */
> +#define FREEBSD_RB_GDB		0x8000	/* use GDB remote debugger instead of DDB */
> +#define FREEBSD_RB_MUTE		0x10000	/* Come up with the console muted */
> +#define FREEBSD_RB_PAUSE	0x100000
> +#define FREEBSD_RB_QUIET	0x200000
> +#define FREEBSD_RB_NOINTR	0x10000000
> +#define FREENSD_RB_MULTIPLE	0x20000000 /* Use multiple consoles */
> +#define FREEBSD_RB_DUAL		FREENSD_RB_MULTIPLE
> +#define FREEBSD_RB_BOOTINFO     0x80000000 /* have `struct bootinfo *' arg */

Usually we have "(1 << 0)", "(1 << 1)", etc for bitmask lists.

> +FUNCTION(grub_unix_real_boot)
> +        call    EXT_C(grub_dl_unload_all)
> +        call    EXT_C(grub_stop_floppy)
> +
> +        cli
> +
> +        popl    %eax
> +        popl	%eax
> +        call	*%eax

Why a call?  Do we need the return address in the stack here?  A comment would
be nice in that case.

> +#define ALIGN_DWORD(a)	((a + 3) & (~3))
> +#define ALIGN_PAGE(a)	((a + 4095) & (~4095))

We already have ALIGN_UP:

  ./include/grub/misc.h:#define ALIGN_UP(addr, align) ((long)((char *)addr + align - 1) & ~(align - 1))

it'd be better to reuse that, I think.

> +static const grub_uint32_t freebsd_flags[] = {
> +  FREEBSD_RB_DUAL, FREEBSD_RB_SERIAL, FREEBSD_RB_ASKNAME,
> +  FREEBSD_RB_CDROM, FREEBSD_RB_CONFIG, FREEBSD_RB_KDB,
> +  FREEBSD_RB_GDB, FREEBSD_RB_MUTE, FREEBSD_RB_NOINTR,
> +  FREEBSD_RB_PAUSE, FREEBSD_RB_QUIET, FREEBSD_RB_DFLTROOT,
> +  FREEBSD_RB_SINGLE, FREEBSD_RB_VERBOSE
> +};

We usually put a newline after the '='.

-- 
Robert Millan

<GPLv2> I know my rights; I want my phone call!
<DRM> What use is a phone call… if you are unable to speak?
(as seen on /.)



  reply	other threads:[~2008-02-11 21:30 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 18:41 [PATCH] a.out support for multiboot and freebsd Bean
2008-02-09 21:57 ` walt
2008-02-10  5:33   ` Bean
2008-02-10  9:22     ` Vesa Jääskeläinen
2008-02-10  9:47       ` Bean
2008-02-10 18:27     ` walt
2008-02-10 22:28       ` Bean
2008-02-11 14:11         ` walt
2008-02-11 14:28           ` Bean
2008-02-11 20:45             ` Bean
2008-02-11 20:46               ` Bean
2008-02-11 21:28                 ` Robert Millan [this message]
2008-02-11 21:46                   ` Bean
2008-02-12 11:16                     ` Robert Millan
2008-02-11 21:51                 ` walt
2008-02-12  4:03                   ` Bean
2008-02-12 11:19                   ` Robert Millan
2008-02-12 18:47                     ` Bean
2008-02-12 19:36                       ` Robert Millan
2008-02-13 10:40                         ` Bean
2008-02-13 15:40                           ` Robert Millan
2008-02-13 16:51                             ` Bean
2008-02-13 17:25                           ` walt
2008-02-13 17:37                             ` Bean
2008-02-13 20:31                               ` walt
2008-02-14  2:43                                 ` Bean
2008-02-15 13:29                                   ` walt
2008-02-15 14:03                                     ` Bean
2008-02-15 14:14                                     ` Bean
2008-02-15 18:43                                       ` walt
2008-02-15 18:58                                         ` Bean
2008-02-16 16:43                                         ` Bean
2008-02-16 18:12                                           ` walt
2008-02-16 18:29                                             ` Bean
2008-02-19 16:41                                               ` Bean
2008-02-15 22:43                                       ` walt
2008-02-16  1:00                                         ` walt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080211212816.GA1064@thorin \
    --to=rmh@aybabtu.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.