grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] Improve FreeDOS direct loading support compatibility.


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH] Improve FreeDOS direct loading support compatibility.
Date: Sat, 07 Jul 2012 14:23:01 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.5) Gecko/20120624 Icedove/10.0.5

On 30.06.2012 07:43, C. Masloch wrote:

>  #define GRUB_FREEDOS_SEGMENT         0x60
> +#define GRUB_FREEDOS_ADDR            (GRUB_FREEDOS_SEGMENT<<4)
>  #define GRUB_FREEDOS_STACK_SEGMENT         0x1fe0
> -#define GRUB_FREEDOS_STACK_POINTER         0x8000
> +#define GRUB_FREEDOS_STACK_BPB_POINTER     0x7c00
> +#define GRUB_FREEDOS_BPB_ADDR        ((GRUB_FREEDOS_STACK_SEGMENT<<4) \
> +                                      +GRUB_FREEDOS_STACK_BPB_POINTER)
> +

Please put spaces around operators.

> +
> +    /* This is not strictly necessary for the current FreeDOS kernel
> +       but improves potential compatibility with the current EDR-DOS
> +       load protocol.

DR-DOS is less-known proprietary software which we usually don't support
as policy. While it's ok to set those registers, please avoid
referencing DR-DOS directly, even in comments.

> +  /* This check could be considered optional, but it provides a more
> +     specific error message than grub_relocator_alloc_chunk_addr would,
> +     and additionally it insures that a little is set aside for the
> +     initial stack as well.
> +     Quirkily, because of its size constraints FreeDOS's original loader
> +     doesn't perform such a check at all (and crashes instead). The file
> +     size limit is documented though. */
> +  if (kernelsyssize > GRUB_FREEDOS_MAX_SIZE)
> +    {
> +      (void)grub_error (GRUB_ERR_BAD_OS,
> +                     "file `%s' is too large for a valid"
> +                     " FreeDOS kernel.sys", argv[0]);

No need of void cast here.
-- 
Regards
Vladimir 'φ-coder/phcoder' Serbinenko

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]