This is an ``unofficial'' page containing information supporting the use of the FreeBSD (and PicoBSD) operating system on the National Semiconductor Geode CPU. The intent of this page is to serve as an unofficial index of available web resources related to FreeBSD on the Geode.
Contents:
Introduction (about this page).
Installation kits (downloadable installation media).
FreeBSD 4.7 installation CD #1 and boot floppies (with Geode patches).FreeBSD Kernel Patches for Geode platforms.
Patching FreeBSD 5.0-Current for the GX1.
TSC patch
Video nonlongword aligned bcopy patch
INT 15/E820 patchPatching FreeBSD 4.x-Stable for the GX1.
FreeBSD PCM Native Audio Driver for NatSemi Geode GX1
Old XFree86 Geode driver (now replaced by ``nsc'' driver.
Old cyrix driver.Building FreeBSD 5.0-Current for the GX1.
Building FreeBSD 4.x-Stable for the GX1.
Building 5.0-Current PicoBSD for the GX1.
Building 4.x-Stable PicoBSD for the GX1.
Thin Client Notes
Diskless FreeBSD on the Aries
Using Compact Flash boot media with the Geode
Using the Compact Flash on the Dorado.
Initializing a Compact Flash for use as a FreeBSD disk.
FreeBSD e-mail
XFree86 (nsc video driver) e-mail
See also the FreeBSD Resources page at this site and the Home page.
Patching FreeBSD 5.0-Current for the GX1.
TSC patch instructions (clock.c).[2] Modify
generic_bcopy()to use byte-moves, not long-moves. The FreeBSDgeneric_bcopy()routine uses arep movslinstruction. The initial address passed togeneric_bcopy()is sometimes non-long-aligned. This should work, but on the GX1 platfroms it hangs. On older Centaurus boards, this problem could be generated by typing backspace. On the current development platforms running 5.0, the system will simply hang doing console I/O.Byte-aligned bcopy patch (support.s).[3] Remove use of an INT 15/AX=E820h BIOS trap from VM86 mode. This trap determines physical memory size and layout. FreeBSD 5.0-Current uses this INT 15 to size physical memory, but will fall back to an earlier memory-sizing scheme if this trap fails. This INT 15 trap on the GX1 development platforms generates a fatal page fault.
VM86 INT 15/E820h patch (machdep.c).The INT 15 patch is not required on FreeBSD 4.x-Stable systems.
FreeBSD 5.0-current TSC patch (clock.c)
Using the 8254 timer instead of the TSC.
/usr/src/sys/i386/isa/clock.c
If the following code occurs at the end of routine
startrtclock(), replace this code:
init_TSC(); }
/* init_TSC(); */ }
If the following code occurs at the end of routine
startrtclock(), replace this code:
if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; tc_init(&tsc_timecounter); }
/*---- BRM -- Dont use TSC. ----*/ #if 0 if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; tc_init(&tsc_timecounter); } #endifSource code prior to February 2003 will require this version of the patch.
What this does is keep the virtual real-time clock that corresponds to the TSC from running.
Byte-alingedgeneric_bcopypatch (support.s)
/usr/src/sys/i386/i386/support.s
ENTRY(generic_bcopy) pushl %esi pushl %edi movl 12(%esp),%esi movl 16(%esp),%edi movl 20(%esp),%ecx movl %edi,%eax subl %esi,%eax cmpl %ecx,%eax /* overlapping && src < dst? */ jb 1f shrl $2,%ecx /* copy by 32-bit words */ cld /* nope, copy forwards */ rep movsl movl 20(%esp),%ecx andl $3,%ecx /* any bytes left? */ rep movsb popl %edi popl %esi ret
ENTRY(generic_bcopy) pushl %esi pushl %edi movl 12(%esp),%esi movl 16(%esp),%edi movl 20(%esp),%ecx movl %edi,%eax subl %esi,%eax cmpl %ecx,%eax /* overlapping && src < dst? */ jb 1f #if 0 shrl $2,%ecx /* copy by 32-bit words */ cld /* nope, copy forwards */ rep movsl movl 20(%esp),%ecx andl $3,%ecx /* any bytes left? */ #else cld /* BRM */ #endif rep movsb popl %edi popl %esi retThis fix is required because of a call in file:
/usr/src/sys/dev/syscons/scvtb.c
FreeBSD 5.0-current patch to not use INT 15/E820 (machdep.c)
/usr/src/sys/i386/i386/machdep.cIn routine
getmemsize(), replace this code:
i = vm86_datacall(0x15, &vmf, &vmc );
#if 0 i = vm86_datacall(0x15, &vmf, &vmc ); #else i = 1; #endifThere is only a single
vm86_datacall()ingetmemsize().This eliminate the attempt to use the INT 15/E820.
Patching FreeBSD 4.x-Stable for the GX1.
TSC patch instructions (clock.c).[2] Modify
generic_bcopy()to use byte-moves, not long-moves. The FreeBSDgeneric_bcopy()routine uses arep movslinstruction. The initial address passed togeneric_bcopy()is sometimes non-long-aligned. This should work, but on the GX1 platfroms it hangs. On older Centaurus boards, this problem could be generated by typing backspace. On the current development platforms running 5.0, the system will simply hang doing console I/O.Byte-aligned bcopy patch (support.s).
FreeBSD 4.x-Stable TSC patch (clock.c)
Using the 8254 timer instead of the TSC.
/usr/src/sys/i386/isa/clock.cAt the end of routine
startrtclock(), replace this code:
if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; init_timecounter(&tsc_timecounter); }
/*---- BRM -- Dont use TSC. ----*/ #if 0 if (tsc_present && tsc_freq != 0 && !tsc_is_broken) { tsc_timecounter.tc_frequency = tsc_freq; init_timecounter(&tsc_timecounter); } #endifWhat this does is keep the virtual real-time clock that corresponds to the TSC from running.
FreeBSD Geode GX1 Native Audio Driver Kit
The following video drivers are available. You should always obtains these from the Xfree86 cvs repository instead of here.
The following build instructions exist:
Building FreeBSD 5.0-Current for the GX1.
Building FreeBSD 4.x-Stable for the GX1.
Building 5.0-Current PicoBSD for the GX1.
Building 4.x-Stable PicoBSD for the GX1.
Building FreeBSD 5.0-CURRENT for GX1-based Systems
- GEODE sample kernel configuration file.
- Patched FreeBSD 5.0-Current source files.
Building FreeBSD 4.6-Stable for GX1-based Systems
- GEODE sample kernel configuration file.
- Patched FreeBSD 4.6-stable source files.
Building PicoBSD 5.0-CURRENT for GX1-based Systems
Patches:
- Patch to the picobsd script - newfs. ( freebsd mailing list)
- Patch to the picobsd script - remove perl. ( freebsd mailing list)
- Patch to PICOBSD bridge reference system for bootable floppy. ( freebsd mailing list)
Files:
- PICOBSD sample kernel configuration file.
- PICOBSD sample crunch file.
- PicoBSD 5.0-Current files.
Building PicoBSD 4-7 Stable for GX1-based Systems
- Building PicoBSD for the Centaurus II.
- Patching the standard ``bridge'' configruation.
- PICOBSD sample kernel configuration file.
- PICOBSD sample crunch file.
- PicoBSD 4.6-Stable files.
Building
picobsdfor the Centaurus II.#cp -R /usr/src/release/picobsd/bridge . #cd bridge (Edit ``crunch.conf'' andPICOBSDif desired - you will likely need the ``crunch.conf'' patches below.) #cd .. #picobsd bridge
The released 4.6-standard bridge ``
crunch.conf'' assumes the ssh port has been installed.The Patch to the released 4.6-stable bridge crunch file:
--- /usr/src/release/picobsd/bridge/crunch.conf Fri Apr 19 05:42:51 2002 +++ crunch.conf Tue Nov 12 17:01:03 2002 @@ -87,7 +87,7 @@ #progs less # 36KB #ln less more #progs more # 24KB -special more srcdir /usr/ports/misc/44bsd-more/work +#special more srcdir /usr/ports/misc/44bsd-more/work progs sysctl progs swapon # 0KB. @@ -122,7 +122,7 @@ # libs -lcurses # for vi #progs tcpdump # 100KB. -special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump +#special tcpdump srcdir /usr/src/usr.sbin/tcpdump/tcpdump progs arp # 0KB. @@ -158,13 +158,13 @@ # Check the ssh license! If you want to use this, # go to /usr/ports/security/ssh-picobsd, do a make extract configure -progs sshd # includes ssh and scp -special sshd objvar SSHD_OBJS -special sshd srcdir /usr/ports/picobsd/ssh-picobsd/work/ssh-1.2.27 -special sshd objdir /usr/ports/picobsd/ssh-picobsd/work/ssh-1.2.27 -ln sshd ssh -ln sshd ssh1 -ln sshd scp +#progs sshd # includes ssh and scp +#special sshd objvar SSHD_OBJS +#special sshd srcdir /usr/ports/picobsd/ssh-picobsd/work/ssh-1.2.27 +#special sshd objdir /usr/ports/picobsd/ssh-picobsd/work/ssh-1.2.27 +#ln sshd ssh +#ln sshd ssh1 +#ln sshd scp ### ee uses ncurses instead of curses libs -ledit -lutil -lmd -lcrypt -lmp -lgmp -lm -lkvm
Using the Compact Flash FreeBSD on the Dorado.
Initializing a Compact Flash for use as a FreeBSD disk.
Using the Compact Flash FreeBSD on the Dorado.
Identify Jumpers J14 and J68 on the Dorado motherboard.
J14 is a 3-pin jumper that is the closest jumper to the Compact Flash connector.
J68 is directly adjacent to the Disk-On-Chip.
Strap J14 so that the CF is master and any HDD the slave, that is, strap pins 1-2:
1-2 Connected (CF is Master) 2-3 Open
Initializing Compact Flash Media for use with the Dorado.
In ``
/etc/defaults/pccard.conf'' assure the following entry exists:# SunDisk Flash ATA # (SanDisk) card "SunDisk" "SDP" config 0x1 "ata" ? insert echo SanDisk Insert remove echo SanDisk Remove# pccard_enable="YES" pccard_mem="DEFAULT"pccard0:on pcic2 pccard1: on pcic2 ... ad6: 30MB [490/4/32] at ata3-master BIOSPIO >pccardc dumpcisThe
dumpciscommand should diplay voluminious output, including:Tuple #5, code = 0x15 (Version 1 info), length = 23 000: 04 01 53 75 6e 44 69 73 6b 00 53 44 50 00 35 2f 010: 33 20 30 2e 36 00 ff Version = 4.1, Manuf = [SunDisk], card vers = [SDP] Addit. info = [5/3 0.6]At this point, output from the command:
>cat /var/log/messagesAug 12 15:13:46 centaurus /kernel: pccard: card inserted, slot 0 Aug 12 15:13:49 centaurus pccardd[49]: Card "SunDisk"("SDP") [5/3 0.6] [(null)] matched "SunDisk" ("SDP") [(null)] [(null)] Aug 12 15:13:55 centaurus /kernel: ata3 at port 0x240-0x247,0x24e irq 5 slot 0 on pccard0 Aug 12 15:13:55 centaurus /kernel: ad6: 30MB[490/4/32] at at a3-master BIOSPIO Aug 12 15:13:55 centaurus pccardd[49]: ata3: SunDisk (SDP) inserted. Aug 12 15:13:55 centaurus pccardd[49]: pccardd started
The following line should appear in
/var/log/messages:Aug 12 15:13:55 centaurus /kernel: ad6: 30MB[490/4/32] at at a3-master BIOSPIO SanDisk, for instance, has devices that contain both ``Manuf = [SunDisk], card vers = [SDP]SunDisk'' as the manufacturer, as well as ``SanDisk''. You may have to create ``pccard.confentries for both. card "SanDisk" "SDP" config 0x1 "ata" ? card "SunDisk" "SDP" config 0x1 "ata" ? You may have to create device nodes for the CF device. In this case, use a command of the form: cd /dev sh MAKEDEV ad8 In some cases (this should no longer be necessary) it may be useful to pccardc enabler 0 ad6 To displa the, The command fdisk -s ad8
Again, your CF device name may vary. In the following examples, device node
ad6is used.fdisk: invalid fdisk partition table found Write the bootsector, use only 1 slice (ignore error about existing "invalid fdisk partition"; none yet exists).>su #dd if=/dev/zero of=/dev/ad6 count=100 100+0 records in 100+0 records out 51200 bytes transferred in 0.285553 secs (179301 bytes/sec)# fdisk -BI ad6 ******* Working on device /dev/ad6 *******Write a Unix volume label (with *ix partition info):
#disklabel -w -B ad6s1 auto Aug 12 15:41:10 centaurus /kernel: ad6: cannot find label (no disk label) Aug 12 15:41:10 centaurus /kernel: ad6s1: cannot find label (no disk label) Aug 12 15:41:10 centaurus /kernel: ad6: cannot find label (no disk label) Aug 12 15:41:10 centaurus /kernel: ad6s1: cannot find label (no disk label)#disklabel -e ad6s1 # /dev/ad6s1c: type: unknown disk: amnesiac label: flags: bytes/sector: 512 sectors/track: 32 tracks/cylinder: 4 sectors/cylinder: 128 cylinders: 489 sectors/unit: 62688 rpm: 3600 interleave: 1 trackskew: 0 cylinderskew: 0 headswitch: 0 # milliseconds track-to-track seek: 0 # milliseconds drivedata: 0 8 partitions: # size offset fstype [fsize bsize bps/cpg] c: 62688 0 unused 0 0 # (Cyl. 0 - 489*) ~ 8 partitions: # size offset fstype [fsize bsize bps/cpg] a: 62688 0 4.2BSD 0 0 # (Cyl. 0 - 489*) c: 62688 0 unused 0 0 # (Cyl. 0 - 489*) ----------------------------------Now create a filesystem on the Compact Flash:
#newfs -b 8192 -f 1024 /dev/ad6s1a Warning: Block size restricts cylinders per group to 23. Warning: 2848 sector(s) in last cylinder unallocated /dev/ad6s1a: 62688 sectors in 16 cylinders of 1 tracks, 4096 sectors 30.6MB in 1 cyl groups (23 c/g, 46.00MB/g, 7680 i/g) super-block backups (for fsck -b #) at: 32At this point you should be able to mount the Compact Flash as if it were a normal disk device:
#mount /dev/ad6s1a /mnt
Documentation
Index of Geode/FreeBSD Relevant e-mail
XFree86 Geode (``
nsc'') video driver e-mailshttp://www.mail-archive.com/devel%40xfree86.org/msg00967.html
National Semiconductors GX1 & Xv -- bug?
http://www.mail-archive.com/devel%40xfree86.org/msg00455.html
Patch-for mode bug in NSC driver.
http://www.mail-archive.com/devel%40xfree86.org/msg00454.html
Patching nsc_drv to allow low-res video modes
Links of Interest
brucem@mail.cruzio.com
Copyright (c) 2003, Bruce R. Montague