Linux on the Samsung n140Just got a new Samsung n140. Very good keyboard and display (not glossy), quiet, long battery life. Not too fast, but nobody would mistake it for a desktop replacement anyways. Still fast enough to use OpenOffice. The n140 comes with XP installed on it (or rather an XP installer that you have to give some info and then it installs). Of course that is only an emergency backup choice, so I put Linux on it as primary OS.
I used Knoppix 6.2 to change partitions and do hardware detection and installed Debian Squeeze ("testing" at this time) with a custom 2.6.32 kernel from kernel.org on it.
If you have additional information on these or any other issue, I will be happy to include it here with attribution. Don't hesitate to send email to me at firstname.lastname@example.org, preferably with "n140: something" in the subject.
Update 15.7.2010: I now use kernel 22.214.171.124. Seems to work as before, except that the network card works with the RTL8169 driver from the kernel. I also had a second go at the wireless card but failed.
Update 15.8.2010: I decided to switch off Hyperthreading. It seems the faked cores are dog-slow on some things and scrolling in Opera became unberably slow. Rather one real core that two pretend ones. Incidentially, I am not surprised. I suspected a long time theh "Hyperthreading" was basically a marketing scam and at least for the Atom that seems to be very true.
Update 24.12.2010: On the last Debian update, X stopped working. As it turns out, the current version of the Intel graphics driver depends on KMS (Kernel Mode Switching) to work. See below under "KMS".
Update 5.6.2011: Finally had another go at the in my case not working inthernal wireless card. It seems the RFKill hardware switch was set to "off" in the BIOS all along, see below. I have no idea whether I messed this up or this was the default the device was delivered with. The location of the BIOS option is under "boot", which is unusual, see below.
Hardware OverviewI will first describe he hardware itself. Linux drivers and software for it are in a separate section below.
Here is the output that Debian Etch with Kernel 2.6.32 produces for the usual hardware queries. Discussion of individual components follows below.
For the impatient, here is my current kernel config file:
CPUIntel Atom N270 1.6GHz, definitely not the fastest CPU on the planet. If you roll your own kernel, you may want to make sure multicore support is on, some things benefit from Hyperthreading, which this CPU can do.
Battery / Power SuppplyI have the 6 cell (5200mAh) battery the n140 is usually sold with (Product ID AA-PB8NC6B). This seems to be a standard battery that is also used by other Samsung netbooks like the NC10. There is also supposedly a 3 cell variant around with something like half the capacity. The power supply that comes with the n140 is a wide input range (100-240V) slim "brick type" and delivers 19V at up to 2.1A to the n140. This should be more than enough to charge the battery while operating the n140 at full power.
LED Control LightsThere are 5 of them. From left to right they are
DisplayNon-glossy with good colors and good brighness, due to LED backlight. 1024x600 resolution. The only thing I do not quite like is that it does not open completely. When sitting down or standing at a lectern with the n140 on it, the angle is still reasonable. Standing before it with the n140 on a low table could be broblematic. My old IBM x31 opens 180 degrees and it sometimes has advantages.
KeyboardVery good. I have an IBM x31 with an excellent keyboard and the n140 is almost as good. No competition for a good desktop-keyboard, but almost no laptop keyboard is.
TouchpadNo idea at the moment. But works out of the box with the X.org /dev/psaux driver. My guess is it emulates a classic two butten PS/2 mouse with scroll-wheel.
GraphicsThis is Intel 945GM/GMS/GME, 943/940GML chipset integrated graphics which uses main memory as graphics memory.
SoundIntel 82801G chipset integrated HD audio.
Ethernet LANThe n140 has a RTL8101e/8102e ethernet chip, which is not supported by a kernel-native driver (as of 2.6.32). RTL offers a driver to download, which may already be in your kernel if you use a distribution kernel. It is in Knoppix 6.2 and the card works out of the box.
Update: With kernel 126.96.36.199 the RTL8169 driver (in the kernel config under 1000Mbit ethernet) works.
Wireless LANAtheros Communications AR9285 PCI-E card.
Note: There are some indications that the AR9285 has issues with kernel 2.6.31. Also the n140 seems to have a software-driven hardware switch that controls the radio part of the card. A driver for linux for this switch seems to be missing.
Update: In the BIOS setup, the default state of the wireless hardware switch can be set under "boot"-"wireless device control". With default on, the card should work under Linux.
BluetoothUSB BCM2046 Bluetooth Device by Broadcom. I did not try to get it to work as I have no need for it.
USBThere are two standard USB ports (right side) and one "high current" port (left side) that can be switched in the BIOS to deliver current while the n140 is off. This feature is useful to charge small, USB charged devices like mobile phones or mp3 players.
The USB chipset is from Intel and uses the EHCI/UHCI driver.
Card ReaderNo idea at the moment. Seems not to be USB or PCI-E directly. Might be ATA.
Repartitioning with Knoppix 6.2Changing partition sizes with gparted worked without problem. Seems the NTFS support is mature. I did change the partition sizes after doing the XP installation, it is possible that repartitioning first causes problems, as the XP installation lets you resize the C: and D: partitions as well. The original partitioning looks like this (forgot to record the exact details):
sda3 gets mounted under /boot and holds the kernel and grub configuration files. sda7 is the main system, sda8 is a rescue system and sda9 is a bit bucket, were I keep an image-backup of sda2 among other things. I left sda1 in place for the moment, until I have investigated what booting with F4 (boots the resuce system from sda1) does when sda1 is not present or used for something else.
Disk /dev/sda: 160.0 GB, 160041885696 bytes 255 heads, 63 sectors/track, 19457 cylinders Units = cylinders of 16065 * 512 = 8225280 bytes Disk identifier: 0x5f63f044 Device Boot Start End Blocks Id System /dev/sda1 1 914 7341673+ 12 Compaq diagnostics /dev/sda2 * 915 2444 12289725 7 HPFS/NTFS /dev/sda3 3474 3498 200812+ 83 Linux /dev/sda4 3499 19457 128190667+ 5 Extended /dev/sda5 3499 7322 30716248+ b W95 FAT32 /dev/sda6 7323 7449 1020096 82 Linux swap / Solaris /dev/sda7 7450 9361 15358108+ 83 Linux /dev/sda8 9362 10636 10241406 83 Linux /dev/sda9 10637 19457 70854651 83 Linux
Drivers and Software for Debian Lenny with Kernel 2.6.32
BatteryBattery levels and state (charging, discharging) can be queried with cat /proc/acpi/battery/BAT1/state. I use a small state monitor written im Perl to give me a status display in X11. Its source and some documantation is here
There is an option in the BIOS to set the battery to higher sustained charge cycles by having it charge only to 80%. Either this does not work under Linux, as the battery gets charged to 100%, or this actully means you can only discharge it down to 20%. As soon as I know, I will update this info.
A full charge will get you something like 6 hours with the disk spinning and medium brightness. This corresponds to around 9W power draw.
Display Brightness(from http://wiki.archlinux.org/index.php/Samsung_N140) setpci -s 00:02.1 F4.B=hh with hh in 00..FF does it, with 00 = off. The link above has a script that can be used to tie this function to keys via xbindkeys. I use the commandline directly.
X.orgKMS (Kernel Mode Setting) apparently works, but I have no experience with it and did not try it. Details at http://wiki.archlinux.org/index.php/Samsung_N140.
X.org Graphics Driver: "intel". Update: Seems from around 12/2010 X.org in Debian stable needs KMS. It is a bit difficult to find in the kernel config (and a stock Debian Linux kernel may or may not work out of the box), bt here is where to find it with 188.8.131.52:
Device Drivers -> Graphics support -> Direct Rendering Manager (DRM [=y]) -> Intel 830M, 845G, 852GM, 855GM, 865G ( [=m]) -> i915 driver (DRM_I915 [=m])Instead of compile as module, you can also statically compile.
External VGA Portxrandr should work. Maximum external resolution is 1920x1080 or greater.
Adding RTL Ethernet DriverWith kernel 184.108.40.206, just use the kernel-integrated RTL8169 driver in the 1000Mbit ethernet section. (No, it will not turn your card magically into Gigabit Ethernet ;-)
With kernel 2.6.32, you need to use the vendor driver. The driver seems to support a broad range of kernels, and should compile and install with most other kernels as well. You need a kernel with modules enabled for this. You also either need the kernel sources or the header package for your running kernel. Instructions below, more detail (if needed) in the README of thed river.
Wireless LANMy n140 has a card by Atheros, with the kernel driver "ath9k" (Kernel config option "Atheros 802.11n wireless cards" in 2.6.32). Some n140 seem to have a different card. It is an add-in card that sits in what looks to me like a PCI-E micro slot on the mainboard. Note that there seems to be an issue with this card in Kernel 2.6.31. Use 2.6.30 or 2.6.32 and later.
The problem here is that the card has a hardware off-switch in the radio that is software controlled by an additional driver. There is no driver under Linux for this switch.
At this time, I can only recommend using an external wireless card, such as the Zyxel NWD271N. I have been using this USB card with the n140 under Linux 220.127.116.11 with good results.
Update: I broght this on myself, it seems. In the BIOS setup, under "boot"-"wireless device control", the hardware RFKill-switch can be disabled at boot.
TSC Instable in IdleIt seems the in-CPU timer has issues when idling. I did not find a way to get rid of the message about the TSC being disabled. The kernel parameter
did not help.
Opening the n140Warning: Although there are no seals, opening the n140 likely voids your warranty.
Warning: Opening the n140 can damage it.
That said, with a bit of dexterity, you can open the n140 with noting more than a few, normally invisible, scratches. If you do not want any scratches, there are generic plastic case-opener kits available from some places, but I do not have experience with them. No large amount of force is needed at any time!
Tools needed are one PH1 screwdriver and optionally a flathead one or other flat tool. I also used some wooden matches to keep already separated areas separated in the beginning. Probably not needed.
Internal HDDIt has a normal 2.5" notebook HDD, in my case a Samsung HM160HI. Other people have reported other drives. I suspect that as long as you stay with a 5400 rpm 2.5" SATA drive with 9.5mm hight (standard, but there are some 12.5mm high ones), you should be fine.
The drive is mounted in a metal drive cage by means of two M3 screws. As that should really be 4 screws, I added two 4mm M3 screws of my own. There is enough space for the heads.
The drive cage is kept in place by a short screw, not a long one like the lower plastric shell. Remove the screw and the cage is held in place only by the SATA connectors. You can then slide it out towards the side of the case, away from the mainboard.
Mounting a new HDD in the drive cage is unproblematic, just remove the screws, swap disk and put in the screws again.
RTC Clock BatteryThere is also a lithium battery (betweem mainboard and upper part of the case), that may eventually need replacement after 5-7 years. It is attached to the mainboard via two cables and a connector.
If you want to reset the RTC, there is a pair of contacts to the right (non-screw side) in the memory slot. They are marked "RTC reset", shortening them out should reset your RTC (and BIOS) settings, but I have not tried this. These contaces can be reached without opening the n140, removing the memory slot cover is enough.