Arduino: Core memory for your pc

A picture of Arduino core memory

Arduino Core memory shield

While the site, corememoryshield.com is more so geared to making your own, they do provide the information needed to build your own core memory…

One has to wonder if in the future, some kids will struggle to get a hard disk working, or perhaps attach DRAM to a pc…

Then again I am pretty sure that SIMH, emulates machines that most certainly used core & drum memory…

retromud creeks on.

and on.

retromud web page

retromud web page

I’ve gotten it listed, and gussied up a web page!

But to be honest it seems that version 2 is pretty scarce.. I’ll have to see about what it takes to add more stuff, or maybe an upgrade… I just hope it doesn’t entail replacing the whole OS!

Then again NetBSD 1.2 is possibly old enough….

I just saw on the PCC mailing list that it just built NetBSD

From Iain Hibbert:

On Mon, 9 May 2011, Anders Magnusson wrote:

> Modified Files:
> pcc/arch/i386: table.c
>
> Log Message:
> Simple fix to avoid bug reported in Jira#PCC-343 by Iain Hibbert.

and so, pcc achieves another milestone..

kernel text is mapped with 3 large pages and 302 normal pages
Loaded initial symtab at 0xc0e37650, strtab at 0xc0ecdaa0, # entries 38363
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 5.99.48 (PCC) #1: Tue May 10 07:49:08 BST 2011
[email protected]:/var/work/NetBSD-current/obj.i386/sys/arch/i386/compile/PCC
total memory = 127 MB
avail memory = 110 MB
mainbus0 (root)
cpu0 at mainbus0 apid 0: QEMU Virtual CPU version 0.13.0, id 0x633
cpu1 at mainbus0 apid 1: QEMU Virtual CPU version 0.13.0, id 0x633
ioapic0 at mainbus0 apid 2
acpi0 at mainbus0: Intel ACPICA 20110211
pckbc1 at acpi0 (KBD, PNP0303) (kbd port): io 0x60,0x64 irq 1
pckbc2 at acpi0 (MOU, PNP0F13) (aux port): irq 12
FDC0 (PNP0700) at acpi0 not configured
LPT (PNP0400) at acpi0 not configured
COM1 (PNP0501) at acpi0 not configured
hpet0 at acpi0 (HPET, PNP0103-0): mem 0xfed00000-0xfed003ff
apm0 at acpi0: Power Management spec V1.2
pckbd0 at pckbc1 (kbd slot)
pckbc1: using irq 1 for kbd slot
wskbd0 at pckbd0 mux 1
pms0 at pckbc1 (aux slot)
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pci0 at mainbus0 bus 0: configuration mode 1
pchb0 at pci0 dev 0 function 0: vendor 0x8086 product 0x1237 (rev. 0x02)
pcib0 at pci0 dev 1 function 0: vendor 0x8086 product 0x7000 (rev. 0x00)
piixide0 at pci0 dev 1 function 1: Intel 82371SB IDE Interface (PIIX3) (rev. 0x00)
piixide0: primary channel interrupting at ioapic0 pin 14
atabus0 at piixide0 channel 0
piixide0: secondary channel interrupting at ioapic0 pin 15
atabus1 at piixide0 channel 1
piixpm0 at pci0 dev 1 function 3
piixpm0: vendor 0x8086 product 0x7113 (rev. 0x03)
piixpm0: 24-bit timer
piixpm0: interrupting at ioapic0 pin 9
iic0 at piixpm0: I2C bus
vga1 at pci0 dev 2 function 0: vendor 0x1013 product 0x00b8 (rev. 0x00)
wsdisplay0 at vga1 kbdmux 1
drm at vga1 not configured
wm0 at pci0 dev 3 function 0: Intel i82540EM 1000BASE-T Ethernet, rev. 3
wm0: interrupting at ioapic0 pin 11
wm0: Ethernet address 52:54:00:12:34:56
makphy0 at wm0 phy 1: Marvell 88E1011 Gigabit PHY, rev. 0
makphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
isa0 at pcib0
lpt0 at isa0 port 0x378-0x37b irq 7
com0 at isa0 port 0x3f8-0x3ff irq 4: ns16550a, working fifo
com0: console
com0: kgdb
attimer0 at isa0 port 0x40-0x43
pcppi0 at isa0 port 0x61
midi0 at pcppi0: PC speaker
sysbeep0 at pcppi0
isapnp0 at isa0 port 0x279
npx0 at isa0 port 0xf0-0xff
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
attimer0: attached to pcppi0
acpicpu0 at cpu0: ACPI CPU
acpicpu1 at cpu1: ACPI CPU
wd0 at atabus0 drive 0
wd0:
wd0: 5000 MB, 10158 cyl, 16 head, 63 sec, 512 bytes/sect x 10240000 sectors
atapibus0 at atabus1: 2 targets
cd0 at atapibus0 drive 0: cdrom removable
pad0: outputs: 44100Hz, 16-bit, stereo
audio0 at pad0: half duplex, playback, capture
boot device: wd0
root on wd0a dumps on wd0b
mountroot: trying smbfs…
mountroot: trying ntfs…
mountroot: trying nfs…
mountroot: trying msdos…
mountroot: trying lfs…
mountroot: trying ext2fs…
mountroot: trying ffs…
root file system type: ffs
clock: unknown CMOS layout
init: copying out path `/sbin/init’ 11
Tue May 10 07:50:12 GMT 2011
Starting root file system check:
/dev/rwd0a: file system is clean; not checking
swapctl: setting dump device to /dev/wd0b
swapctl: adding /dev/wd0b as swap device at priority 0
Starting file system checks:
Setting tty flags.
Setting sysctl variables:
ddb.onpanic: 2 -> 0
Starting network.
Hostname: qemu
IPv6 mode: host
Configuring network interfaces:.
Adding interface aliases:.
Building databases: dev, utmp, utmpx, services done
encoding -> uk
Starting syslogd.
Mounting all filesystems…
Clearing temporary files.
Updating fontconfig cache: done
Creating a.out runtime link editor directory cache.
Checking quotas: done.
swapctl: setting dump device to /dev/wd0b
Starting virecover.
Checking for core dump…
savecore: no core dump
Starting local daemons:.
Updating motd.
Starting inetd.
Starting cron.
Tue May 10 07:52:31 GMT 2011

NetBSD/i386 (qemu) (console)

login: root
May 10 07:52:45 qemu login: ROOT LOGIN (root) on tty console
Last login: Tue May 10 07:46:44 2011 on console
Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
2006, 2007, 2008, 2009, 2010, 2011
The NetBSD Foundation, Inc. All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
The Regents of the University of California. All rights reserved.

NetBSD 5.99.48 (PCC) #1: Tue May 10 07:49:08 BST 2011

Welcome to NetBSD!

This system is running a development snapshot of the NetBSD operating system,
also known as NetBSD-current. It is very possible that it has serious bugs,
regressions, broken features or other problems. Please bear this in mind
and use the system with care.

You are encouraged to test this version as thoroughly as possible. Should you
encounter any problem, please report it back to the development team using the
send-pr(1) utility (requires a working MTA). If yours is not properly set up,
use the web interface at: http://www.NetBSD.org/support/send-pr.html

Thank you for helping us test and improve NetBSD.

Terminal type is vt100.
We recommend that you create a non-root account and use su(1) for root access.
qemu# ls
.cshrc .klogin .lesshst .login .profile .shrc
qemu# cat >test.c
int
main(int ac, char *av[])
{
printf(“Hello World!\n”);
return 0;
}
^D
qemu# pcc -o test test.c
qemu# ./test
Hello World!
qemu# shutdown -p now
Shutdown NOW!
shutdown: [pid 369]
qemu#
wall: You have write permission turned off; no reply possible

*** FINAL System shutdown message from root@qemu ***
System going down IMMEDIATELY

May 10 07:54:14 qemu shutdown: poweroff by root:

System shutdown time has arrived

About to run shutdown hooks…
Stopping cron.
Waiting for PIDS: 345.
Stopping inetd.
Waiting for PIDS: 308.
Removing block-type swap devices
swapctl: removing /dev/wd0b as swap device
Tue May 10 07:54:57 GMT 2011

Done running shutdown hooks.
May 10 07:55:10 qemu syslogd[151]: Exiting on signal 15
syncing disks… 3 done

unmounting 0xcb6de004 /proc (procfs)…
unmounting 0xcb68f004 /dev/pts (ptyfs)…
unmounting 0xcb65f604 /kern (kernfs)…
unmounting 0xca77820c / (/dev/wd0a)…
unmounting 0xca77820c / (/dev/wd0a)…
cd0: detached
sysbeep0: detached
midi0: detached
atapibus0: detached
npx0: detached
pcppi0: detached
atabus1: detached
makphy0: detached
wm0: detached
pchb0: detached
audio0: detached

unmounting 0xca77820c / (/dev/wd0a)…
forcefully unmounting / (/dev/wd0a)…
wd0: detached
atabus0: detached
acpi0: entering state S5

Some speedup with AberMUD & 4.3 UWISC.

So I found out why it’s now taking FOREVER to logon to the mud..

It turns out that there were nearly 4000 entries in the hosts file. Wow that’s a tad crazy eh? I guess this tape of BSD shows what the internet was like before DNS. I also bumped the CPU up to 4%.. it’s far more snappier.

Now to see if I can get added to abermud.info

Also as mentioned in the prior post, the AberMUD tape doesn’t just magically install, you have to run the install.sh & install2.sh which will recompile everything and set some paths, then install the DB in /usr/tmp as -iy7AM .. I guess it’s harder to forcefully delete it. Anyways logon as ‘debugger’ set yourself up a password, then run ‘reset’ to finalize the placement of everything….

And looking at the mud_syslog you can see fun stuff like this:

GAME ENTRY: Neozeed[root]
GAME ENTRY: Neozeed[root]
GAME ENTRY: Gatto[root]
GAME ENTRY: Geophoto[root]
Neozeed slain by The Yeti
GAME ENTRY: Neozeed[root]
GAME ENTRY: Erazmus[root]
GAME ENTRY: Neozeed[root]
GAME ENTRY: Jose[root]
GAME ENTRY: Neozeed[root]
GAME ENTRY: Nek[root]
Nek slain by The Yeti
GAME ENTRY: Lumpy[root]

So I don’t feel that bad being slain by the Yeti. Maybe one of us can kill the thing.

** UPDATE **

>
The Yeti attacks you
You hit The Yeti with the scimitar
Your last blow did the trick

>
The Yeti has just died

AberMud

I never was that much into MUD’s but after reading this and this, I decided to go for it. Looking here, I thought I’d go with David Kinder’s revamping of the version 2 source.

I figured I’d try to run AberMUD on 2.11BSD / PDP-11 which didn’t go so well.. I know there is issues with the word size (it tries to switch on longs which it doesn’t like, I changed them to int’s and.. well sigbus. Not to mention I had to link with overlays and well.. I get the feeling you actually have to do something not just trust the linker.

32v is just too crusty, along with 3.0 BSD. 4.2 BSD was lacking a few functions (memcpy/strchr) so I grabbed some replacements and it just crashed. Looking back AberMUD dates from the late 1980’s so I figured 4.3 BSD would be a far better match. And I figured 4.3 from Wisconsin would certainly work the best for my needs. This time, only a minimal amount of hacking on the source was required, and more importantly it worked!

So here is a tape file with the source & binary.

The next thing I figured I’d do is put it online. Now my VPS runs a 64bit version of Linux, and seeing this is a VAX exe/OS I’ll need to run it on SIMH. Since I’m going to allow people to telnet it (I guess I could go thru some hell with the serial line mux) I’ll need my SLiRP build of SIMH, which only runs clean as a 32bit exe. So to get things started, first install 32bit support on x86_64 debian like this:

apt-get install ia32-libs

Then using Slackware 13.37, I made my exe, and uploaded it… And it worked fine! I also set the cpu to throttle at 3% so I don’t get into trouble for running 100% of the time, and it’ll be about as slow as a real VAX 11/730… It’s a simple line in SIMH, but I tend to misplace things so here it is.

set throttle 3%

Simple, right?

Well I thought I’d make one more change. I hate those systems that make you login to run the designated program that you went there for in the first place. At the same time, this VM is born to MUD, why not let it MUD all the time? Simply replacing /bin/login with mud.1 let me do just that. And of course I could just add an option in mud.1 to allow me to have a normal OS login. Simple, right? Not to mention it works on the console just fine.

So, let’s connect!

telnet vpsland.superglobalmegacorp.com

I suppose I could hook up flashterm to it later, but for now, telnet on in. I’ve never run a MUD before so I guess we’ll see. Worst case it’ll suck and crash and the only evidence will be the tape image, and this post.

Dead end on the ISA disks.

Well I really thought I was going to make some headway on this.

But the answer was no.

However for the sake of completeness, let me at least document what I did.. The IBMPC hardware is initalized in hw/pc_piix.c

You’ll find this little GEM:

if (pci_enabled) {
PCIDevice *dev;
dev = pci_piix3_ide_init(pci_bus, hd, piix3_devfn + 1);
idebus[0] = qdev_get_child_bus(&dev->qdev, “ide.0”);
idebus[1] = qdev_get_child_bus(&dev->qdev, “ide.1”);
} else {
for(i = 0; i < MAX_IDE_BUS; i++) { ISADevice *dev; dev = isa_ide_init(ide_iobase[i], ide_iobase2[i], ide_irq[i], hd[MAX_IDE_DEVS * i], hd[MAX_IDE_DEVS * i + 1]); idebus[i] = qdev_get_child_bus(&dev->qdev, “ide.0”);
}
}

So I did the obvious thing and just wrapped it with a ‘pci_enabled=0;’ and a ‘pci_enabled=1’, basically turning off PCI for the IDE initialization so it’d load the isa_ide_init proc. Well that just then crashed Qemu when it was reconciling geometry for the NVRAM. 20 minutes with GDB and I figure that the code has morphed enough that it’s basically expecting 2 IDE controllers, and the ISA thing just isn’t building out what it wants so it’s just a quick fix in hw/pc.c

static void pc_cmos_init_late(void *opaque)

ide_get_bs(hd_table, arg->idebus0);
ide_get_bs(hd_table + 2, arg->idebus1);

So I comment out the second ide_get_bs and lo Qemu doesn’t crash anymore! But the BIOS says there is no hard disks?! So I’m figuring it’s a SeaBIOS issue, so checking their changelog, I see that there is something about not trusting ISA controllers on PCI systems.

So I’ll just have to back out that change, or just hack the thing to re-enable ISA IDE controllers. Luckily this was kind of easy to spot, as someone had left the magical words ‘isapc’ in ata.c

if (!CONFIG_COREBOOT && !pcicount) {
// No PCI devices found – probably a QEMU “-M isapc” machine.
// Try using ISA ports for ATA controllers.
init_controller(0, -1, IRQ_ATA1
, PORT_ATA1_CMD_BASE, PORT_ATA1_CTRL_BASE, 0);
init_controller(1, -1, IRQ_ATA2
, PORT_ATA2_CMD_BASE, PORT_ATA2_CTRL_BASE, 0);
}

So all I had to do was ensure that this was called, no matter what (comment out the if, leave the block). Sadly MinGW couldn’t build SeaBIOS so I spent the better part of an hour downloading Slackware 13.37 (which was … less then expected) fighting with it’s frame buffer, then the linker gave me this exciting bit.

cannot move location counter backwards (from 00000000000067e0 to 0000000000000000)

Good grief.

The fix is to apparently use binutils 2.20.51 . Slackware came with 2.21.51 .. Which apparently broke this needed function (again). So I wound up downloading the source from the MinGW project of all things (I know, wth?) having fun with p7zip (it installs a 7za?!) then I could FINALLY build my BIOS. First a generic test to make sure it works, then the modified one.

And into the crash. To verify I at least was doing what I thought, I turned on some debugging in the BIOS, which seamed normal, and then just fired up qemu with this flag:

-monitor telnet:127.0.0.1:2023,server,nowait

So I can telnet in, and capture the full device tree. Which you get with…

info qtree

And you can see, the IDE is indeed on the ISA bus.

bus: main-system-bus
type System
dev: hpet, id “”
gpio-in 1
dev-prop: timers = 3
dev-prop: msi = off
mmio fed00000/00000400
dev: i440FX-pcihost, id “”
bus: pci.0
type PCI
dev: PIIX4_PM, id “”
dev-prop: smb_io_base = 45312
bus-prop: addr = 01.3
bus-prop: romfile =
bus-prop: rombar = 1
bus-prop: multifunction = off
bus-prop: command_serr_enable = on
class Bridge, addr 00:01.3, pci id 8086:7113 (sub 1af4:1100)
bus: i2c
type I2C
dev: smbus-eeprom, id “”
bus-prop: address = 87
dev: smbus-eeprom, id “”
bus-prop: address = 86
dev: smbus-eeprom, id “”
bus-prop: address = 85
dev: smbus-eeprom, id “”
bus-prop: address = 84
dev: smbus-eeprom, id “”
bus-prop: address = 83
dev: smbus-eeprom, id “”
bus-prop: address = 82
dev: smbus-eeprom, id “”
bus-prop: address = 81
dev: smbus-eeprom, id “”
bus-prop: address = 80
dev: PIIX3, id “”
bus-prop: addr = 01.0
bus-prop: romfile =
bus-prop: rombar = 1
bus-prop: multifunction = on
bus-prop: command_serr_enable = on
class ISA bridge, addr 00:01.0, pci id 8086:7000 (sub 1af4:1100)
bus: isa.0
type ISA
dev: isa-ide, id “”
dev-prop: iobase = 0x170
dev-prop: iobase2 = 0x376
dev-prop: irq = 15
isa irq 15
bus: ide.0
type IDE
dev: ide-drive, id “”
dev-prop: unit = 0
dev-prop: drive = ide1-cd0
dev-prop: logical_block_size = 512
dev-prop: physical_block_size = 512
dev-prop: min_io_size = 0
dev-prop: opt_io_size = 0
dev-prop: bootindex = -1
dev-prop: discard_granularity = 0
dev-prop: ver = “0.14.0”
dev-prop: serial = “QM00003”
dev: isa-ide, id “”
dev-prop: iobase = 0x1f0
dev-prop: iobase2 = 0x3f6
dev-prop: irq = 14
isa irq 14
bus: ide.0
type IDE
dev: ide-drive, id “”
dev-prop: unit = 0
dev-prop: drive = ide0-hd0
dev-prop: logical_block_size = 512
dev-prop: physical_block_size = 512
dev-prop: min_io_size = 0
dev-prop: opt_io_size = 0
dev-prop: bootindex = -1
dev-prop: discard_granularity = 0
dev-prop: ver = “0.14.0”
dev-prop: serial = “QM00001”
dev: isa-fdc, id “”
dev-prop: driveA = floppy0
dev-prop: driveB =
dev-prop: bootindexA = -1
dev-prop: bootindexB = -1
isa irq 6
dev: port92, id “”
dev: i8042, id “”
isa irqs 1,12
dev: isa-parallel, id “”
dev-prop: index = 0
dev-prop: iobase = 0x378
dev-prop: irq = 7
dev-prop: chardev = parallel0
isa irq 7
dev: isa-serial, id “”
dev-prop: index = 0
dev-prop: iobase = 0x3f8
dev-prop: irq = 4
dev-prop: chardev = serial0
isa irq 4
dev: mc146818rtc, id “”
dev-prop: base_year = 2000
dev: i440FX, id “”
bus-prop: addr = 00.0
bus-prop: romfile =
bus-prop: rombar = 1
bus-prop: multifunction = off
bus-prop: command_serr_enable = on
class Host bridge, addr 00:00.0, pci id 8086:1237 (sub 1af4:1100)
dev: ioapic, id “”
gpio-in 24
mmio fec00000/00001000
dev: fw_cfg, id “”
dev-prop: ctl_iobase = 0x510
dev-prop: data_iobase = 0x511
mmio ffffffff/00000002
mmio ffffffff/00000002
dev: apic, id “”
dev-prop: id = 0
mmio fee00000/00100000

So while it didn’t do what I wanted, this kind of was a good way to see that I could at least enable ISA IDE hard disks on Qemu.

I can only wonder why on earth they are still broken with regards to Netware.

And this is why Linux will never take over anything.

So here we are, 2011. Linux has been around for nearly 20 years.

Would you like to load custom fonts?

No thanks, I’m fine with VGA.

Well FUCK YOU!

Look guys, it’s been WAY too long, and really this is unacceptable. I’ve tried to live the ‘year of the linux desktop’ back in 1994, 1995 ad nauseum, and really, when it comes to simple stuff, like a TEXT MODE INTERFACE, and it’s fucked up… Yeah Linux will remain where it is. And that’s nowhere.

I know that the 0.7% of the internet will rush in to apologize, or flame, because Linux simply cannot drive a simple VGA console, or how it’s my fault, but really get a grip.

It’s 2011, and asking for a normal textmode install is a fucking disaster. I can almost expect that after 40 years of Linux it’ll still fail.