Multi-boot the Jetson Nano?

Greetings!

I have an original 4 gig Jetson Nano, (barrel connector for power, one camera port, WiFi adapter), that I bought back when they first came out and it’s a Hot Smokin’ Weapon, especially for robotics experimenting on the cheap.

Background:
The Raspberry Pi has the capability of booting to one of several operating systems based on some external status - in my case I use a 5-position DIP-switch to select the desired OS at power-up by grounding a particular GPIO pin.

I am planning on using the Jetson Nano as a part of some robotics experiments, and it is very likely that I will need to have more than one OS conveniently available, possibly on an external SSD, that I want to switch between at-will.

On the Raspberry Pi, you can do this by creating a “master” boot partition that checks for a particular situation and then restarts the boot process after redirecting the Pi to an actual boot partition which takes control as if it were the only boot partition available.

Question:
Is there an equivalent capability for the Jetson Nano, where I can take a large external SSD and divide it into multiple test environments and boot into a specific OS configuration without having to swap the boot media?

Thanks!

I don’t think this will work on most Jetsons, at least not the older ones (and it might be an experiment on newer Jetsons). Jetsons don’t have a BIOS, and so everything a BIOS would do, along with the boot chain, is more or less custom and not interchangeable. Newer hardware did move to UEFI though, which greatly improves the situation, and it might be possible on those (especially Orin under L4T R36.x/JetPack 6). Although L4T R35.x (requires Xavier or Orin) is using UEFI there was never any o/s other than a specific Ubuntu release set up. R36.x is more or less still a preview release, but it has gone a long way towards the interchangeable o/s abilities you want.

1 Like

Ok.  I am translating that to mean “Nobody has tried and/or succeeded yet”

This is an entire topic in itself. . . .

Suffice it to say that unless you’re using an Altair 8800,

Altair_8800

or an early mainframe,

ibm_System_370
 

. . . .(both of which have front-panel switches for hand-loading a bootstrap loader)

Without front-panel switches, everything has to have a “BIOS” of sorts.  Otherwise it would never be able to find the boot media and load the operating system.  The “NVIDIA” banner, (and the boot error messages, if any), are part of the Jetson Nano’s “BIOS”, otherwise you’d have to spend 30 minutes hand-loading the bootstrap loader - one binary byte at a time - every time you wanted to run the beastie because the ONLY thing a processor chip knows how to do at startup is load one byte/word of data from some preset address, load it into the CPU’s Instruction Register and execute it.  (It’s usually a 3 byte/word Jump Immediate to wherever the bootstrap loader is stored.)

If you are interested, we can discuss this in a different topic.

This being the case, is there any comprehensive documentation on the partition structure of the media and a detailed description of the boot process?

Thanks!

What most people think of as a BIOS is an actual micro operating system that self-boots, and then has a job of bringing up power rails and clocks in the right order. Later, it publishes interfaces and transfers control to boot media. On a modern PC motherboard, if you don’t have a dual BIOS (basically a fallback BIOS), then a BIOS failure means scrapping the motherboard (or unsoldering memory from the BIOS, reprogramming it, then soldering it back in). Typically known as “bricking” because it cannot be repaired by software means (I see a lot of people call a non-booting system “bricked”, but this is very very incorrect terminology since the unit can simply be flashed again).

It is correct that everything has a method of bringing up power rails and clocks, training memory and bus speeds, so on. The difference is whether there is a dedicated processor which is isolated such that it is not part of the regular boot chain. Jetson’s do have a PMIC (Power Management IC) and some support for bringing up the system, but it does not exist in its own separate memory. This is flashed along with boot chain during a normal flash. This is also why it is not “standardized”. The UEFI of newer models does standardize to some extent, but you still cannot just wipe the memory used in the o/s and boot chain without also wiping the bring-up of power rails, clocks, memory training, so on…there is not an isolated micro operating system for this. Once the newer models get past the hardware-dependent side of UEFI, the Jetson becomes compatible. You just have to be careful to know that partitions or parts of QSPI need to remain untouched to get to that point.

Long ago I did work on a mainframe hard drive system (it was the worlds highest density storage at the time). The controller had 14 inch Winchester floppy drives, and was the size of a large refrigerator. The actual hard drive was the size of a washer or dryer machine. Depending on the model, the permanent magnets weighed either 42 pounds or 44 pounds and were too heavy to pick up by hand (and you certainly did not want to get between metal and the magnet in the wrong spot). It ran on 440V three-phase, and if a power supply failed, the top cage was intentionally weakened; the explosion would embed metal in the concrete ceiling. Hearing protection was required to be near one long term. Ahh, the bad old days! 😂

With a non-UEFI Jetson you would have a far more difficult job getting another o/s installed. You would have to use an initrd method I think. Jetsons (until very recently) had only kernels which have custom code. The kernel and that code (which is part of the kernel) will have requirements for the operating environment (inheriting a certain machine state), and probably unusual arguments to pass to some of the drivers (the device tree is passed as an argument, but some of the drivers this passes to are not in the stock kernel). An alternative operating system which is capable of using the default kernel stands a much better chance of succeeding since the environment is set up for that, and the device tree and other arguments passed to it are designed for that kernel and device tree.

You are also correct though about simply passing control to a particular address and beginning execution. For the Linux kernel it would be the address of IRQ vector table. Much of the environment being passed by existing state though comes from software in very early boot stages which is not public information. If JTAG or DSTREAM (which seems particular to ARM) could be used it would be a much easier job, but you won’t find support for that.

I don’t know of comprehensive docs. The earliest parts, the 3P server and TBoot, are not generally available, but if you put in the specific model at this URL, then you might find the bring-up or adaptation guides provide some help (this tends to be more for custom carrier board development, or going from one Jetson generation to another):
https://developer.nvidia.com/embedded/downloads

1 Like

It makes me wonder if anyone has ever tried “bare-metal” programming on the Nano?

Back in the 808x days it was all so simple.  Now you need a Ph.D. in Nuclear Physics to even think about it.  Even the Raspberry Pi requires some serious jumping through hoops to bare-metal program it. . .

That reminds me of the pictures I saw of a GIGANTIC hard drive being loaded into a PanAm cargo plane using a forklift.


(And that high pitched whining sound ISN’T the hard drive, it’s the electric meter!)
 


(Poor fellow. . . Don’t drop it!)
 

Is this what you were talking about?

No, that’s actually much older. The drives I worked on were from a place now out of business, STC (Storage Technology Corporation). They were used with mainframes. I’d be surprised if the one in the picture (which is far before my time despite my being ancient) holds 10 MB. The ones I worked only only required a pallet jack to move, and the higher density ones (the size of a washer/drier) held I think 6 GB. There were no analog gauges like in the one picture, but they did have the stereotypical blinking lights such as all of the original Star Trek series shows on their computers.

I couldn’t find any pictures of the specific units, but the top picture in this one has a controller outside of one of their tape changers, and is representative of the “refridgerator sized” controller used on up to two drives:
https://www.chipsetc.com/stc-storage-technology-corporation.html

1 Like

I forgot to mention, lots of people do bare metal on Jetsons, although you usually won’t hear about it. Most of the early boot stage is created from assembler I think. It is a bit “out of style” though to build assembler into drivers or kernel code without good reason due to the non-portability. It is fairly easy to use assembler in user space if you really want to since GCC supports inline assembler.

At one point I did disassemble a kernel (on a TK1 I think?) to see the IRQ vector table at the correct address just out of curiosity. About the only time I think someone will intentionally write assembler is to optimize something they are not afraid of losing portability.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.