experience setting up a low memory machine

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

experience setting up a low memory machine

rgcinjp
misc@

sharing a recent experience with OpenBSD 6.6 and old, low spec, low memory
devices.

remember the Toshiba Libretto? back in 2000, OpenBSD got some CPU time on
one of mine. sadly that Libretto is now dead, and with the current state of
affairs, it wont be able to run OpenBSD.

last weekend i was able to snag one of the Libretto's cousin. this one is a
Cassiopeia Fiva 102. sligthly larger than the 70CT. has a touchpad, has USB,
a parallel, serial, IRDA, VGA, PS/2 port, an extra USB port on the dock. it
has 64Mb RAM (32Mb base + a 32Mb DIMM in the slot), expandable to 96Mb ...
if i can find old DIMMs. 6Gb PATA drivea. Cardbus slot. CPU is a Cyrix.
battery is toast but ... still a good looking ~20 year old laptop.

first order of bussiness, upgrade the disk. i have a 2x CF to PATA adapter
which i used. this adapter has a jumper to select which CF is the master.
for installing -current, i dded the install66.fs to a 512Mb CF. set that as
master and a 64Gb Sandisk as slave. install was smooth. first boot was OK.
then i noticed a big problem. the system seems to "hang" after 10mins.
testing more, i let the machine stand overnight. no change. i have the
command prompt, pressing ENTER creates a new line but i don't get the prompt
back. maybe it is the CF card. switched cards. tried 32Gb and 16Gb. same.

i thought it was the RAM ... i disable Fast boot ... and POST detected no
issues with the RAM. also i"ve installed -current several times already with
no hiccups, if the DIMM had issues it should have manifested when
decompressing the large tarball packages.

mounted the CF with "noatime" -> no change
vm.swapencrypt.enable = 0 -> no change
library_aslr=NO -> no change

in one final effort, i reinstalled everything again, rebooted, log in ...
and started top(1). lo and behold ... after 10mins i got my "hang" and a
probable culprit ...

every boot OpenBSD relinks the kernel ... i stared at the top display and
saw ld on top with around 170Mb ... literally out of memory ... and out of
swap space. on machines with small memory swap is configured by disklabel
as 2x physmem.  in my case 122Mb swap was calculated but it was not enough
for the kernel relinking.

reinstalled everything again but customized the disklabel ... 4Gb of swap
was configured ... well i did waste 2Gb since 32-bit archs can only use 2Gb
and i'm too lazy to re-install again.


so that's something to watch out for when setting up low memory systems.
i was expecting ld to just segfault ... bec of the out of memory condition
but i never saw a segfault.


at the moment no more psuedo "hangs" ... but relink spews out an error
on every reboot:

(SHA256) /bsd: OK
LD="ld" LDFLAGS="-g" sh makegap.sh 0xcccccccc gapdummy.o
ld -T ld.script -X --warn-common -nopie -o newbsd ${SYSTEM_HEAD} vers.o ${OBJS}
size: newbsd: not object file or archive
*** Error 1 in /usr/share/relink/kernel/GENERIC (Makefile:1125 'newbsd': @size newbsd ; umask 007;  echo mv newbsd newbsd.gdb; rm -f newbsd....)


- and dc0 (i have 2 of these, 32-bit PC Card)

dc0 at cardbus0 dev 0 function 0 "Xircom X3201-3" rev 0x03: irq 11, address 00:06:29:xx:xx:xx
tqphy0 at dc0 phy 0: 78Q2120 10/100 PHY, rev. 11

can't see anyone on my network ... i see the ARP packets but i
can not ping anyone on my newly created network (sneakernet via USB
flash drives with BE and LE machines is complicated).

these cards work on my Powerbook G4.


- but axe0 works! slow (3-4ms ping to a local machine) ... but it works.

axe0 at uhub1 port 1 configuration 1 interface 0 "Apple Computer Ethernet A1277" rev 2.00/0.01 addr 3
axe0: AX88772, address 10:9a:dd:xx:xx:xx
ukphy0 at axe0 phy 16: Generic IEEE 802.3u media interface, rev. 1: OUI 0x000ec6, model 0x0006


- so does urtwn0

urtwn0 at uhub1 port 2 configuration 1 interface 0 "I-O DATA DEVICE, INC. WN-G150UM" rev 2.00/2.00 addr 4
urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, address 34:76:c5:xx:xx:xx

but not much testing done yet.


- and urndis0 has issues  

urndis0 at uhub1 port 2 configuration 1 interface 0 "Sony 501SO" rev 2.00/3.10 addr 3
urndis0: using RNDISurndis0: IOERROR
urndis0: query failed
: unable to get hardware address
ugen0 at uhub1 port 2 configuration 1 "Sony 501SO" rev 2.00/3.10 addr 3
urndis0 detached
ugen0 detached
ugen0 at uhub1 port 2 "Sony 501SO" rev 2.00/3.10 addr 3
ugen0 detached


- of course no Xorg


yorosiku ~

PS
and thanks for all the efforts of past and present developers ...

PPS
back to trying to understand PPC assembly and ofw ...



OpenBSD 6.6-current (GENERIC) #502: Thu Jan 16 11:34:46 MST 2020
    [hidden email]:/usr/src/sys/arch/i386/compile/GENERIC
real mem  = 63979520 (61MB)
avail mem = 47181824 (44MB)
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: date 01/13/00, BIOS32 rev. 0 @ 0xfb970
apm0 at bios0: Power Management spec V1.2 (slowidle)
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xbde8
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfdfc0/48 (1 entries)
pcibios0: PCI Exclusive IRQs: 11
pcibios0: no compatible PCI ICU found
pcibios0: Warning, unable to fix up PCI interrupt routing
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0x8000 0xc8000/0x2000! 0xef000/0x1000!
cpu0 at mainbus0: (uniprocessor)
cpu0: Cyrix MediaGXtm MMXtm Enhanced ("CyrixInstead" 586-class) 26 MHz, 05-04-00
cpu0: FPU,TSC,MSR,CX8,CMOV,MMX
cpu0: TSC disabled
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Cyrix GXm PCI" rev 0x00
cbb0 at pci0 dev 1 function 0 "Ricoh 5C475 CardBus" rev 0x00: irq 11
pcib0 at pci0 dev 18 function 0 "Cyrix GXm ISA" rev 0x00
ohci0 at pci0 dev 19 function 0 "Compaq USB OpenHost" rev 0x04: irq 11, version 1.0, legacy support
cardslot0 at cbb0 slot 0 flags 0
cardbus0 at cardslot0: bus 1 device 0 cacheline 0x0, lattimer 0x20
pcmcia0 at cardslot0
isa0 at pcib0
isadma0 at isa0
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
com1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
com1: probed fifo depth: 0 bytes
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pms0 at pckbc0 (aux slot)
wsmouse0 at pms0 mux 0
pms0: Synaptics touchpad, firmware 4.6, 0xb5aa1 0x0
vga0 at isa0 port 0x3b0/48 iomem 0xa0000/131072
wsdisplay0 at vga0 mux 1: console (80x25, vt100 emulation), using wskbd0
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
wdc0 at isa0 port 0x1f0/8 irq 14
wd0 at wdc0 channel 0 drive 0: <SDCFXS-064G>
wd0: 1-sector PIO, LBA48, 61064MB, 125059072 sectors
wd1 at wdc0 channel 0 drive 1: <SDCFXS-064G>
wd1: 1-sector PIO, LBA48, 61064MB, 125059072 sectors
wd0(wdc0:0:0): using BIOS timings
wd1(wdc0:0:1): using BIOS timings
sb0 at isa0 port 0x220/24 irq 5 drq 1: dsp v4.12
midi0 at sb0: <SB MIDI UART>
audio0 at sb0
opl at sb0 not configured
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt1 at isa0 port 0x278/4: polled
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
usb0 at ohci0: USB revision 1.0
uhub0 at usb0 configuration 1 interface 0 "Compaq OHCI root hub" rev 1.00/1.00 addr 1
dc0 at cardbus0 dev 0 function 0 "Xircom X3201-3" rev 0x03: irq 11, address 00:06:29:xx:xx:xx
tqphy0 at dc0 phy 0: 78Q2120 10/100 PHY, rev. 11
uhub1 at uhub0 port 1 configuration 1 interface 0 "NEC hub" rev 1.00/1.00 addr 2
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on wd0a (fd825aac8xxxxxxxx.a) swap on wd0b dump on wd0b

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

nothingness
I wouldn't call 64Mb "small" for memory, it's tiny. Even 20 years ago 64
wasn't really enough. The introduction of kernel relinking on boot has
been noted since 6.5 (or was it 6.4?) to make tiny memory systems
obsolete. They simply can't cope. Theo has noted he has other projects
in the pipeline that will make that situation even worse. The only thing
I can recommend is to stick to an older version of the OS and not use
the machine for anything needing web browsing. It can still be a useful
console terminal to headless devices, for example.

Good luck,

Noth

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Stefan Sperling-5
In reply to this post by rgcinjp
On Fri, Feb 14, 2020 at 10:01:06PM +0900, rgc wrote:
> every boot OpenBSD relinks the kernel ... i stared at the top display and
> saw ld on top with around 170Mb ... literally out of memory ... and out of
> swap space. on machines with small memory swap is configured by disklabel
> as 2x physmem.  in my case 122Mb swap was calculated but it was not enough
> for the kernel relinking.

On an alix board with 256MB of RAM + 2G swap it is holding up OK.

With low-spec machines like this you need to add lots of swap or you will
need to get a bit creative. You can't use out of the box defaults on this
machine in any case, so some tweaking is required anyway.

For library relinking there's an rc.conf.local option to turn it off.

You can disable automatic kernel relinking, there is one obvious line
to remove from /etc/rc. You can still relink the kernel occasionally if
you want the added security.
Secret tip: You can compile an i386 kernel on a fast amd64 machine which
will also "relink" the kernel of course, just go into sys/arch/i386 and
do the usual kernel compile steps. Don't tell anyone I told you that!

If you want to go further and have another faster i386 machine you can follow
the release(8) man page to build custom release sets for your i386 laptop with
all the tweaks it needs included.

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Stefan Sperling-5
In reply to this post by nothingness
On Sat, Feb 15, 2020 at 01:54:56AM +0100, Noth wrote:
> The only thing I can recommend is to stick to an older version of the OS

I wouldn't recommend running old releases, at least not until i386
officially becomes an unsupported platform.

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Dumitru Moldovan-2
In reply to this post by nothingness
On Sat, Feb 15, 2020 at 01:54:56AM +0100, Noth wrote:
>I wouldn't call 64Mb "small" for memory, it's tiny. Even 20 years ago
>64 wasn't really enough.

Not really, about 21 years ago I was learning to get XFree86 working,
to break free from the console on a desktop with 24MB of RAM.  Built
that machine with 16MB of RAM in 1998.  Around year 2000, prices of
memory modules significantly increased because of market troubles in
Southeast Asia.  So it took me some time to get to 32MB of RAM in the
end, definitely less than 20 years ago.

To put things in perspective, it was possible to run KDE 1.0 in 24MB of
RAM comfortably.  Biggest memory hog was Netscape, the only usable web
browser on Linux and Unix systems at the time.  A screenshot from that
era: http://toastytech.com/guis/dvxxserv.png.

Obligatory XKCD reference: https://www.xkcd.com/386/  :-]

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Stuart Longland
On 15/2/20 6:43 pm, Dumitru Moldovan wrote:
> Not really, about 21 years ago I was learning to get XFree86 working,
> to break free from the console on a desktop with 24MB of RAM.

It's all relative… I can recall years ago experimenting with operating
systems on old machines (even by that day's standards)… trying to get
Slackware Linux running in 4MB RAM.

Today, I'm trying to cram stuff into 32kB of RAM and thinking how 4MB
and a MMU would be luxury!  (Even RetroBSD needs 128kB.)

I'm sure someone on here will tell me how they used to flip switches on
a front panel to fill the whopping 128 bytes of RAM on their 8080 with
machine code whilst dreaming of a punched tape loader and a few more
DRAM chips.

I would suggest any "modern" multi-tasking general purpose OS such as
OpenBSD, Linux, etc, you're looking at a minimum of 256MB RAM.  In the
future, probably consider doubling that… and again.

I have an old PII 300MHz laptop with 160MB RAM, and while it boots Linux
just fine (I had it running Gentoo doing AX.25 packet radio stuff),
firing up a web browser (Firefox) to check the weather is unusably slow.

I could throw OpenBSD on it, but not sure that would really make much
difference: kernel re-linking is going to be painful on that machine.

Sometimes it's better to realise when something has past its prime.
--
Stuart Longland (aka Redhatter, VK4MSL)

I haven't lost my mind...
  ...it's backed up on a tape somewhere.

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Jordan Geoghegan-3


On 2020-03-11 00:13, Stuart Longland wrote:

> On 15/2/20 6:43 pm, Dumitru Moldovan wrote:
>> Not really, about 21 years ago I was learning to get XFree86 working,
>> to break free from the console on a desktop with 24MB of RAM.
> It's all relative… I can recall years ago experimenting with operating
> systems on old machines (even by that day's standards)… trying to get
> Slackware Linux running in 4MB RAM.
>
> Today, I'm trying to cram stuff into 32kB of RAM and thinking how 4MB
> and a MMU would be luxury!  (Even RetroBSD needs 128kB.)
>
> I'm sure someone on here will tell me how they used to flip switches on
> a front panel to fill the whopping 128 bytes of RAM on their 8080 with
> machine code whilst dreaming of a punched tape loader and a few more
> DRAM chips.
>
> I would suggest any "modern" multi-tasking general purpose OS such as
> OpenBSD, Linux, etc, you're looking at a minimum of 256MB RAM.  In the
> future, probably consider doubling that… and again.
>
> I have an old PII 300MHz laptop with 160MB RAM, and while it boots Linux
> just fine (I had it running Gentoo doing AX.25 packet radio stuff),
> firing up a web browser (Firefox) to check the weather is unusably slow.
>
> I could throw OpenBSD on it, but not sure that would really make much
> difference: kernel re-linking is going to be painful on that machine.
>
> Sometimes it's better to realise when something has past its prime.

A year or two ago I had OpenBSD working on my iBook with 64MB of RAM,
even got FVWM working on it. For fun and testing purposes, I ran some
small OpenBSD virtual machines with 64MB RAM as well. A few years back I
got OpenBSD to boot with 32MB, but it wasn't particularly usable. I've
found 128MB to be usable for basic terminal work, but you're definitely
correct about 256MB being the bare minimum for anything fancy or GUI
related.


Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Aaron Mason
On Wed, Mar 11, 2020 at 6:47 PM Jordan Geoghegan <[hidden email]> wrote:

>
>
>
> On 2020-03-11 00:13, Stuart Longland wrote:
> > On 15/2/20 6:43 pm, Dumitru Moldovan wrote:
> >> [SNIP]
> > [SNIP]
> >
> > Sometimes it's better to realise when something has past its prime.
>
> A year or two ago I had OpenBSD working on my iBook with 64MB of RAM,
> even got FVWM working on it. For fun and testing purposes, I ran some
> small OpenBSD virtual machines with 64MB RAM as well. A few years back I
> got OpenBSD to boot with 32MB, but it wasn't particularly usable. I've
> found 128MB to be usable for basic terminal work, but you're definitely
> correct about 256MB being the bare minimum for anything fancy or GUI
> related.
>
>

At work I run OpenBSD 6.1 in a VM for Request Tracker.  It has 512MB
RAM and it seems that may very well be overkill.  At previous jobs I
can ManageEngine ServiceDesk Plus and even in Linux you needed 2GB
minimum just for it to get out of bed.  I plan on rebuilding it with
6.6 (can't update RT because packages are too old in 6.1) and might
run it on 256MB for shits and giggles.

--
Aaron Mason - Programmer, open source addict
I've taken my software vows - for beta or for worse

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Jordan Geoghegan-3


On 2020-03-11 19:20, Aaron Mason wrote:

> On Wed, Mar 11, 2020 at 6:47 PM Jordan Geoghegan <[hidden email]> wrote:
>>
>>
>> On 2020-03-11 00:13, Stuart Longland wrote:
>>> On 15/2/20 6:43 pm, Dumitru Moldovan wrote:
>>>> [SNIP]
>>> [SNIP]
>>>
>>> Sometimes it's better to realise when something has past its prime.
>> A year or two ago I had OpenBSD working on my iBook with 64MB of RAM,
>> even got FVWM working on it. For fun and testing purposes, I ran some
>> small OpenBSD virtual machines with 64MB RAM as well. A few years back I
>> got OpenBSD to boot with 32MB, but it wasn't particularly usable. I've
>> found 128MB to be usable for basic terminal work, but you're definitely
>> correct about 256MB being the bare minimum for anything fancy or GUI
>> related.
>>
>>
> At work I run OpenBSD 6.1 in a VM for Request Tracker.  It has 512MB
> RAM and it seems that may very well be overkill.  At previous jobs I
> can ManageEngine ServiceDesk Plus and even in Linux you needed 2GB
> minimum just for it to get out of bed.  I plan on rebuilding it with
> 6.6 (can't update RT because packages are too old in 6.1) and might
> run it on 256MB for shits and giggles.
>

I wouldn't get too excited about running on low memory machines. The
more RAM you can throw at something, the better, as this allows more
cache room as well as improving function of ASLR and other memory
randomizations.

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Stuart Henderson
On 2020-03-13, Jordan Geoghegan <[hidden email]> wrote:
> I wouldn't get too excited about running on low memory machines. The
> more RAM you can throw at something, the better, as this allows more
> cache room as well as improving function of ASLR and other memory
> randomizations.

It does allow more cache, but what matters for ASLR is address space, not RAM.

Reply | Threaded
Open this post in threaded view
|

Re: experience setting up a low memory machine

Jordan Geoghegan-3


On 2020-03-13 18:31, Stuart Henderson wrote:
> On 2020-03-13, Jordan Geoghegan <[hidden email]> wrote:
>> I wouldn't get too excited about running on low memory machines. The
>> more RAM you can throw at something, the better, as this allows more
>> cache room as well as improving function of ASLR and other memory
>> randomizations.
> It does allow more cache, but what matters for ASLR is address space, not RAM.
>

Ah okay, you're right. I was remembering reading something about low
memory conditions weakening ASLR, but after doing a quick check, it
seems it was an implementation specific issue with Windows and Linux.