{"id":544,"date":"2023-10-14T01:12:29","date_gmt":"2023-10-13T22:12:29","guid":{"rendered":"https:\/\/netbsd.name\/?p=544"},"modified":"2023-10-14T01:25:06","modified_gmt":"2023-10-13T22:25:06","slug":"booting-netbsd-hp-620lx","status":"publish","type":"post","link":"https:\/\/netbsd.name\/?p=544","title":{"rendered":"Booting NetBSD on HP 620LX"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Few weeks ago I got an opportunity to buy <a href=\"https:\/\/en.wikipedia.org\/wiki\/HP_620LX\">HP 620LX<\/a> handheld PC. It is a small device based on Hitachi SH7709 <a href=\"https:\/\/en.wikipedia.org\/wiki\/SuperH#SH-3\">SH-3<\/a> ~75MHz SoC with 16MB RAM, one CompactFlash slot and one CardBus (PCMCIA) slot. It also has an option to connect serial cable (cable comes with the device). The default operating system is Windows CE 2.0 (or 2.11 if you are lucky to find the ROM upgrade). <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">System was untested and didn&#8217;t have original power adapter, however was packaged in original box with most accessories available. Fortunately, the system booted successfully using 12V 1A adapter (the original adapter provides 2A if I am not mistaken), giving me an opportunity to test NetBSD on it. HP 620LX is <a href=\"http:\/\/wiki.netbsd.org\/ports\/hpcsh\/hpcsh_support_status\/\">supported<\/a> by hpcsh port, which aims to run on various handheld devices based on SH-3\/4 SoCs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Installation process is not completely trivial on this type of devices.  One <strong>important <\/strong>point is that booting NetBSD will completely reset Windows CE device, loosing all configuration and data, thus backup is required, if it contains something important to the user (not in my case). There&#8217;s no <a href=\"https:\/\/man.netbsd.org\/sysinst.8\">sysinst(8)<\/a> support, CF memory  card should be prepared in advance on another NetBSD system. The instructions are available <a href=\"https:\/\/wiki.netbsd.org\/tutorials\/how_to_install_netbsd_on_hpcsh\/\">here<\/a>, even more detailed instructions can be found <a href=\"https:\/\/2004.eurobsdcon.org\/uploads\/media\/EBSD04_37.pdf\">here<\/a> (thanks @uwe for pointing this document in the <a href=\"https:\/\/mail-index.netbsd.org\/port-hpcsh\/2023\/10\/11\/msg000905.html\">mailing list<\/a>). To make the long story short: two partitions should be prepared: one DOS partition of the &#8220;small&#8221; size (20-30MB), and at least one FFS partition for NetBSD root partition. The DOS partition needs to include kernel file and a boot loader application. Distribution sets should be extracted to the NetBSD partition(s) (at least base, etc IMHO), and initial configuration can be done for \/etc\/rc.conf, \/etc\/fstab, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once everything is ready, hpcboot.exe needs to be executed from Windows CE. Choosing the right bootloader executable appeared to be the first challenge though. <a href=\"http:\/\/nycdn.netbsd.org\/pub\/NetBSD-daily\/HEAD\/latest\/hpcsh\/installation\/\" data-type=\"link\" data-id=\"nycdn.netbsd.org\/pub\/NetBSD-daily\/HEAD\/latest\/hpcsh\/installation\/\">Installation<\/a> directory in the port&#8217;s distribution contains sh3-hpcboot.exe and sh4-hpcboot.exe with seemingly the obvious choice for SH-3 based device. The caveat is that the binary is build for Windows CE 2.11 and above, and it fails to run on Windows CE 2.0. My initial fear was that I would need to build one myself with the right tools. Fortunately, I found one in the NetBSD <a href=\"https:\/\/github.com\/NetBSD\/src\/tree\/trunk\/sys\/arch\/hpc\/stand\/binary\/SH3\">code<\/a>  instead. It is <a href=\"https:\/\/man.netbsd.org\/uudecode.1\">uuencoded<\/a>, thus should be decoded first by running command <code>uudecode -o hpcboot.exe hpcboot200.exe.uue<\/code>. The bootloader program allows to choose the device and several boot flags, and after few seconds NetBSD boot messages appear on the screen. On initial boot I faced the second issue, related to disk labels. The main reason was that my FFS partition was not labeled as wd0a. It appeared to be an easy fix <code>sudo disklabel -e \/dev\/rsd3<\/code> (rsd3 may differ on your device) and just edit and save label from f-&gt;a (in my case) in the opened editor. Soon after I had a properly booting system and could successfully login to the system. Here the final configuration can be performed, like creation of users, setting the passwords, etc. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What&#8217;s next? First of all, I plan to add hpc200.exe to distribution files. After, I would like to enable some of my pcmcia devices (wifi card and SATA card), test network, test serial, and just to keep port a little bit more alive! Time will tell.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Enjoy dmesg below for now:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><span class=\"collapseomatic \" id=\"id6acc2540374bc\"  tabindex=\"0\" title=\"NetBSD 10.99.9 on HP 620LX\"    >NetBSD 10.99.9 on HP 620LX<\/span><div id=\"target-id6acc2540374bc\" class=\"collapseomatic_content \"><br>Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003,<br>2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013,<br>2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023<br>The NetBSD Foundation, Inc. All rights reserved.<br>Copyright (c) 1982, 1986, 1989, 1991, 1993<br>The Regents of the University of California. All rights reserved.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">NetBSD 10.99.9 (GENERIC) #0: Wed Oct 4 07:51:36 UTC 2023<br>mkrepro@mkrepro.NetBSD.org:\/usr\/src\/sys\/arch\/hpcsh\/compile\/GENERIC<br>HP 620LX<br>total memory = 16384 KB<br>avail memory = 12896 KB<br>timecounter: Timecounters tick every 15.625 msec<br>mainbus0 (root)<br>cpu0 at mainbus0: SH3 73.728 MHz PCLOCK 18.432 MHz<br>cpu0: 16KB\/16B 4-way set-associative I\/D-unified cache.<br>cpu0: U0, P0, P3 write-back; P1 write-through<br>cpu0: 4-way set-associative 128 TLB entries<br>cpu0: VPN mode, multiple virtual storage mode<br>btnmgr0 at mainbus0<br>wskbd2 at btnmgr0 mux 1<br>shb0 at mainbus0<br>rtc0 at shb0<br>scif0 at shb0<br>adc0 at shb0<br>j6x0tp0 at adc0<br>wsmouse0 at j6x0tp0 mux 0<br>wskbd1 at j6x0tp0 mux 1<br>j6x0lcd0 at shb0: brightness 21, contrast 21<br>hd64461if0 at shb0<br>hd64461video0 at hd64461if0: frame buffer = 512 KB , console<br>hpcfb0 at hd64461video0: 640&#215;240 pixels, 256 colors, 80&#215;24 chars<br>wsdisplay0 at hpcfb0 kbdmux 1: console (std, vt100 emulation)<br>wsmux1: connecting to wsdisplay0<br>wskbd2: connecting to wsdisplay0<br>wskbd1: connecting to wsdisplay0<br>hpcfb: 640&#215;240 pixels, 256 colors, 80&#215;24 chars<br>hpcfb: 640&#215;240 pixels, 256 colors, 80&#215;24 chars<br>hpcfb: 640&#215;240 pixels, 256 colors, 80&#215;24 chars<br>wsdisplay0: screen 1-3 added (std, vt100 emulation)<br>hd64461pcmcia0 at hd64461if0<br>com0 at hd64461if0autoconfiguration error: : device problem. don&#8217;t attach.<br>pfckbd0 at mainbus0<br>hpckbd0 at pfckbd0<br>wskbd0 at hpckbd0: console keyboard, using wsdisplay0<br>hpcapm0 at mainbus0: pseudo power management module<br>apmdev0 at hpcapm0: Power Management spec V1.2<br>timecounter: Timecounter &#8220;tmu_pclock_4&#8221; frequency 4608075 Hz quality 0<br>timecounter: Timecounter &#8220;clockinterrupt&#8221; frequency 64 Hz quality 0<br>pcmcia0 at hd64461pcmcia0<br>pcmcia1 at hd64461pcmcia0<br>wdc0 at pcmcia1 function 0:<br>wdc0: memory mapped mode<br>WARNING: system needs entropy for security; see entropy(7)<br>atabus0 at wdc0 channel 0<br>wd0 at atabus0 drive 0<br>wd0:<br>wd0: drive supports 1-sector PIO transfers, LBA addressing<br>wd0: 488 MB, 993 cyl, 16 head, 63 sec, 512 bytes\/sect x 1000944 sectors<br>wd0: 32-bit data port<br>swwdog0: software watchdog initialized<br>WARNING: 1 error while detecting hardware; check system log.<br>boot device: wd0<br>root on wd0a dumps on wd0b<br>root file system type: ffs<br>kern.module.path=\/stand\/hpcsh\/10.99.9\/modules<br>entropy: best effort<br><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Few weeks ago I got an opportunity to buy HP 620LX handheld PC. It is a small device based on Hitachi SH7709 SH-3 ~75MHz SoC with 16MB RAM, one CompactFlash slot and one CardBus (PCMCIA) slot. It also has an option to connect serial cable (cable comes with the device). The default operating system is &hellip; <a href=\"https:\/\/netbsd.name\/?p=544\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Booting NetBSD on HP 620LX<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-544","post","type-post","status-publish","format-standard","hentry","category-netbsd"],"_links":{"self":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/544","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=544"}],"version-history":[{"count":5,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/544\/revisions"}],"predecessor-version":[{"id":550,"href":"https:\/\/netbsd.name\/index.php?rest_route=\/wp\/v2\/posts\/544\/revisions\/550"}],"wp:attachment":[{"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=544"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=544"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netbsd.name\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=544"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}