Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 12 Jul 2020 00:32:08 +0300
From:      Lytochkin Boris <lytboris@gmail.com>
To:        freebsd-amd64@freebsd.org
Subject:   More than 1G of loader-visible RAM?
Message-ID:  <CAEJYa-Q50KSYJ6rKjRw-otgeLuMOZ2xoB94PxPaLzon8Yd6q3g@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi.

I am trying to make a patch that gives loader ability to bring whole
partitions as preload md(4) items. While this could sound a bit crazy, it
allows making an easy to get "diskless" routers: root partition is 2Gb
stored on HDD and I have 4Gb of RAM loader can get root partition into
memory and kernel will use it as a root partition. Once OS is up and
running, HDD can be set to sleep mode (via /etc/rc.local or similar)

Currently I do the same thing via init_script that detects boot partition,
run mdconfig and dd. Delegating this job to loader will make this setup
much more straightforward.

Currently my patch for loader can copy partitions up to ~1G and it seems
this is a limitation in stand/i386/libi386/elf64_freebsd.c:
====
    /*
     * This is kinda brutal, but every single 1GB VM memory segment points
to
     * the same first 1GB of physical memory.  But it is more than adequate.
     */
    for (i = 0; i < 512; i++) {
...
====
Comment comes from 2003 which was quite adequate back then. I am not that
fluent in real memory programming thus I write this email seeking a hint if
this 1Gb RAM limitation can be altered allowing more memory to be used by
loader that will be functional.

-- 
Boris Lytochkin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAEJYa-Q50KSYJ6rKjRw-otgeLuMOZ2xoB94PxPaLzon8Yd6q3g>