Re: BOOT_CS

From: Etienne Lorrain (etienne_lorrain_at_yahoo.fr)
Date: 02/25/04

  • Next message: Pavel Machek: "Re: kgdb: rename i386-stub.c to kgdb.c"
    Date:	Wed, 25 Feb 2004 11:30:43 +0100 (CET)
    To: linux-kernel@vger.kernel.org
    
    

    me wrote:
    > Keep initrd few Mb after kernel because I do not know where exactly
    > to uncompress it - anyway the kernel will itself move it where it
    > wants it.

    hpa wrote:
    > If you absolutely want to do this -- for pretty much no reason -- you
    > can either decompress it twice, decompress it to nowhere (after all,
    > the kernel will decompress it when it starts) or move it into place
    > before starting the kernel.

      There is another reason to keep the two parts together, but I
     acknowledge this one is fadding away: the problem appears when loading
     Linux (+ initrd) from a DOS floppy or from operating system dated 98
     "reboot to DOS" menu.
     You then usually have an environment whith EMM386 active and the
     processor in virtual 86 mode + paged memory. Most of the times you
     also have a disk cache software loaded first just after the BIOS
     ROM, at the place you want to load Linux.
     You can still have hope: it has always been possible to do DMA in a
     XMS allocated memory (himem.sys managed) so the physical address is
     equal to the virtual address in these blocks.

     What I did is simply load and uncompress Linux to a legally allocated
     HIMEM block (so that is a 100 % compatible DOS software, you can use
     a network disk or a disk cache for that) and check everything is right
     before disabling interruption, switch back to real mode with
     4 Gb segments of non paged memory, copy the block at the right place,
     and start Linux in protected mode.
     You have to remember keeping the code short in between the back switch
     to real mode and the start of Linux because the data (Linux kernel)
     is at a clear physical address, but your code itself is in a 4 Kbyte
     page which is available - but the page after it may not be loaded
     so no more code...

     When the problem of loading the initrd happen, you have two choice:
     load another XMS block or use the same one as the kernel.
     And here is the problem: if you load another XMS block with the
     initrd, which is usually smaller than the kernel (Kb size wise),
     you may get it in a block of XMS at the _beginning_ of extended
     memory in physical address - because of the first fit algorithm of
     himem.sys. Then, to move the kernel at its final position, you have
     to first move the initrd out of the way to not overwrite it, it
     begins to be complex to write this bit of assembler and debug at
     this point is not so easy.
     That is the short version why in some cases I did not try to load the
     initrd at the end of memory (just allocating one big block of XMS memory
     with a hole of few Mbytes in between the two - and then move the
     complete block - the complete block could not be of the size of the
     total memory). And if it is not always done, to move initrd at end,
     no need to do it only sometimes.
     Note also that in this corner case the size of the RAM may be tricky
     and could be given as a Linux command line parameter, so the position
     of the initrd is not trivial. I do not want to load the initrd after the
     RAM itself...

      Was just for info, not for flamewar,
      Etienne.

    Yahoo! Mail - Votre e-mail personnel et gratuit qui vous suit partout !
     Créez votre adresse sur http://mail.yahoo.fr
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Pavel Machek: "Re: kgdb: rename i386-stub.c to kgdb.c"

    Relevant Pages

    • PC104 board boot off compact flash, load initrd, and execute out of ramdisk
      ... It is a PC/104 industrial board running Linux. ... CDROM go away, it needs to boot entirely off the compact-flash card, ... I created my initrd image file using the 'dd' command then ... So I have it starting to boot, have the CF card formatted, a kernel on ...
      (comp.os.linux.embedded)
    • Re: booting from ISO image on HD?
      ... >> through customized initrd files for each one. ... > between the loopback device and the underlying file (the iso image). ... I have to insmod the loop kernel module(e.g. ... how can you boot it from an initrd??? ...
      (comp.os.linux.misc)
    • Re: fsck fails during boot with 2.6.9-34.0.1.EL kernel because root filesystem is already rw mou
      ... I think there was a little fault in building the new initrd. ... The mount-command of the init-script is wrong and makes confusing, e.g.: first the root-filesystem must mount read/write, it accepts. ... It looks like in the early stage of the booting, when the kernel is using the initrd to load the ... I still do not understand why in my new initrd file, with the new kernel, the root filesystem is ...
      (RedHat)
    • Re: 2.6.26-rc5-mm1
      ... In my case it turns out to be gcov patches - in which I'm interested ... initrd overwrites kernel: When kernel and initrd are loaded to static ... minimal memory configuration any more. ...
      (Linux-Kernel)
    • Re: problem compiling kernel
      ... installing them in the grub boot menu, and then, now, the boot crashes do ... the boot logs of my working kernel, I could see that RAID was as modules. ... perhaps replace it and recreate initrd. ...
      (Debian-User)