Sunday, 20 December 2015

Adding my usb 64gb drive to the pi

I picked up a 64gb Nano usb for the pi this week. I used Amazon but, in the rather bizarre way I have of buying, I also use a service called for a lot of my Amazon purchases. It actually allows you to use digital Bitcoins via Amazon wishlists to make purchases. The mechanics of it are a bit dull but you usually get a discount via purse  of 5% upwards. So I shave a few pence off each purchase.

However after the device arrived my troubles began. It basically wasn't recognised. There is a reason for this and it goes back about 30 years.

USB drives were designed as floppy disk replacements originally. Big floppy disks but definitely removeable. For this reason they use a variation of the FAT filesystem. FAT is 'File Allocation Table'. The original 8 bit FAT format was designed for floppy disks with a capacity of 180kb (single sided).
Image result for floppy disk
The original floppy was 8 inches, which then became 5.25 and then became 3.5 inch. It was always 'floppy' but the external cases got harder to make them more resilient. Early data destruction stories include the secretaries that stapled the floppy to the printed hard copy to keep it "safe". Other stories are of disks folded to put into envelopes and so on. Data recovery of the floppy disk was big business at one point.

Back to my issue. As capacity of hard disks rose the FAT file system had to grow. It had to have more space and be able to store the tables of where the files were located. Simply put the numbers kept growing and in the 1980s the maths stopped FAT using disks over over 32mb. FAT12 limited the size to 32MB for a logical sector size of 512 bytes. Hard disks were then often partitioned and weird extenders were used such as disk compression.

Help was at hand. A usable FAT16 came in 1987 with Compaq's DOS 3.31 and the world breathed a sigh of relief. Unfortunately disks started growing again. Extended attributes to files came with IBM OS/2 operating system. On the Microsoft side of the fence Windows 3.x arrived and FAT was straining with friendly file names because FAT supported just 8 characters, a full stop and a 3 character file extension. So with Windows 95 so called 'long file names' were supported but everything stayed compatible with the older systems.

In the 1990s it looked like FAT was now too old because NTFS was the new fully permissioned Microsoft file system for big drives. FAT was being relegated quickly to consumer PCs and old floppy disks. It was dead.

That was until the arrival of USB. Everything still understood FAT so USB memory sticks came with FAT drives. Then the same problem happened. Capacity rose dramatically and the USB drive stopped looking like a big floppy disk. To cope with every expanding USB drives Exfat turned up to be backwards compatible but able to address huge disks of up hundreds of gigs on USB and memory cards for cameras.

Back to my raspberry pi. Simply put beyond 32gb it didn't recognise the USB disk. Immediately the 32 number stuck in my head. It turns out it can't boot from exfat beyond 32gb but does support FAT 32.

Rather than spend too much time with this I used 'fdisk /dev/sda1' to view the partitions on the storage. I deleted all the FAT stuff and created a Linux partition. A format with 'ext2' completed the transformation. Editing fstab allowed me to mount the USB as a native Linux disk and I changed the permissions to let everyone read/write. Since I am the only user it's not really a problem.

All done. It just felt that operating system history had come back to bite me....

Saturday, 12 December 2015

As easy as Pi

A couple of years ago, I dont remember exactly when, I bought a Raspberry Pi. This is a very small computer the size of a cigarette pack. It was supplied basically as a circuit board where you plug in a power supply, keyboard, mouse and monitor. It has an HDMI output for a TV.

The main thing about this is you switch on the power and it boots from an SD Card. 


The problem with this for me was the messy nature of my desk. If the exposed circuit board touches metal and short circuits then you have a problem. That's what I did and a smell of burning hit my nose. 

That was it. Well the PI developed and as a little Christmas treat I bought a replacement. This time with a case to stop me breaking it so easily.

With the new smart case with a raspberry logo, more memory, a microsd and more USB ports it is a bit better than the original but still tiny. It's basically about as powerful as a small smartphone and is targetted at the hobbiests and also the kids who want to code. Yes code!

For the past 25 years or so IT has become business studies. No longer is the practice of IT taught. It morphed into ICT and then the exams were all about developing your own business on Excel and writing a stock control database on Access. IT was mostly business studies. The Pi looks back to an earlier age of the BBC Micro and software being written from scratch.

The Pi runs on Linux not Windows. There is a Windows 10 IOT implementation but I actually like Linux. I hope I will have some time to look at some coding on my Pi but I also want to power it via solar chargers and use it as an ssh terminal into other Unix based systems. In other words a bit of fun.

The link to the BBC Micro is stronger than just invoking a spirit of 30 years ago. The processor in the Pi, and most modern smartphones, is the ARM processor. ARM (Acorn Risc Machine) is a 'system on a chip' (SOC) design that goes right back to the BBC Micro and Acorn Computers - the developer of ARM. The BBC Micro was based on the 6502 motorola processor. The BBC Micro was a branding to accompany a set of BBC television programmes to educate the public about microcomputers. The computer was sold widely into education.

Acorn did not build a PC clone but instead wanted to work with RISC processors. RISC stood for Reduced Instruction Set Computer. In contrast the Intel range of processors used "complex" instructions and were the workhorses of the PC industry. ARM used fewer shorter instructions to the processor to require less power and work faster. Complex instruction systems needed more power but could run faster clock speeds.

The Acorn Archimedes was the successor to the BBC Micro at the end of the 1980s. It was the most powerful personal computer you could buy. However in a world that had standardised on the IBM PC, MSDOS and later Windows the RISC OS was out on it's own.

Intel and Windows won the desktop war but the RISC design continued. The small team in Cambridge built on the RISC chip capability of being powerful with low power. ARM became Advanced RISC Machines Ltd and then designed systems on chip for embedded devices. When smartphones happened the low power ARM chips were ideal for pocket sized devices. Intel is not the master of the smartphone processor but rather the companies that license ARM designs,

The Raspberry Pi, designed in Cambridge uses an ARM chip and is designed, like the original Acorn BBC Micro, to teach kids to code. The combination of the BBC's commitment to educating the nation about microcomputing has led to computing devices worldwide running on ARM processors.