# FreeBSD on N900 or iPhone5S mobile phones?



## mbzadegan (Mar 7, 2015)

Hi,
I read FreeBSD/ARM Project page and going to port FreeBSD to N900 or iPhone5s.
N900 CPU: 600 MHz Cortex-A8
iPhone5s CPU: Dual-core 1.3 GHz Cyclone (ARM v8-based)
Can anyone trying to port FreeBSD on these mobile phones? (even without GSM support)


----------



## mbzadegan (Mar 9, 2015)

Isn't that any idea?
Does FreeBSD ARM image can be process on Cortex-A8?


----------



## albertobsd (May 7, 2015)

Maybe, but, it's difficult to set up the Kernel on the iPhone. (I don't know about the N900 boot process).
Read about RAM disk for iPhone 4 but it is an A4.


----------



## plast0000 (Sep 12, 2015)

On N900, maybe, someone managed to run Darwin on it (the base of iOS and OS X) so you should be able to get FreeBSD running too.

For the iPhone, you can't.


----------



## Handy92 (Dec 31, 2015)

Loader from smartphone must be own (probably only way is swap "BIOS" chip, I do not think if Apple permit access on chip) to load BSD system or Bootloader from BSD must be spoof. If my think line is correct. Another difficulty is how to put inside BSD? Easy way is load from SD card but Loader loads only from Inside Memory, and from my experience loader is branded. Is hard Reverse Engineering challenge, Get the "BIOS" from flash chip, decompile to assembler, change part of code corresponding for "search bootloader" compile and write it on phone, Good luck. And good luck from hardware support 

For money easier is write some Free OS and selling phone, but who buy it? There is nothing new to offer. Maybe borrow Google Play, but still is hard to do.


----------



## tingo (Jan 1, 2016)

Interesting thread, I recently got a N900 from a friend. The phone is interesting as is, but if somebody manages to port FreeBSD to it, I'll try it.


----------



## Handy92 (Jan 1, 2016)

FreeBSD actually is ported to ARM technology. But still is not easy. FreeBSD use some BIOS function to run, so probably BIOS must be changed.

https://en.wikipedia.org/wiki/Coreboot

https://en.wikipedia.org/wiki/SeaBIOS

http://processors.wiki.ti.com/index.php/Booting_Linux_kernel_using_U-Boot



> *Das U-Boot* (Universal Bootloader) is an open source, primary boot loader *used in embedded devices to package the instructions to boot the device's operating system kernel.* It is available for a number of computer architectures, including 68k, ARM, AVR32, Blackfin, MicroBlaze, MIPS, Nios, SuperH, PPC and x86.



https://en.wikipedia.org/wiki/Das_U-Boot

https://www.youtube.com/watch?v=tRUlJ2GXI04



> boot loader software held on a storage device designated as a "boot device", such as a hard disk, a floppy disk, CD, or DVD. It loads and executes the first boot software it finds, giving it control of the PC.[12] This is the process that is known as _booting_ (sometimes informally called "booting up"), which is short for "bootstrapping". The BIOS selects candidate boot devices using information collected by POST and configuration information from EEPROM, CMOS RAM or, in the earliest PCs, DIP switches. Following the boot priority sequence in effect, BIOS checks each device in order to see if it is bootable. For a disk drive or a device that logically emulates a disk drive, such as a USB Flash drive or perhaps a tape drive, to perform this check the BIOS attempts to load the first sector (boot sector)


 Tat is the point Apple BIOS can load only Apple software.


----------



## tingo (Jan 2, 2016)

Handy92 said:


> FreeBSD use some BIOS function to run, so probably BIOS must be changed.


Only so far as the booting part; once the FreeBSD kernel has started, BIOS (or other firmware; UEFI, u-boot) isn't used.
(Yes, the kernel might inherit environment variables from the firmware, but that is a different thing.)


----------



## Handy92 (Jan 2, 2016)

U-boot is bootloader is a part of FreeBSD or other system. Not hardware.


----------



## cpm@ (Jan 21, 2016)

First step to port FreeBSD to a Wileyfox Swift.

https://twitter.com/zxombie/status/671429307785478144


----------



## antranigv (Oct 5, 2016)

Any news anyone? I think Sevan (FreeBSD dev) manager to run NetBSD on Nokia N900, I assume only compiling it for the hardware, configuring the U-Boot will be enough (I managed to run another Linux once like that on N900).


----------



## sko (Oct 6, 2016)

It's been a while since I played around in the guts of my N900, but as it will be replaced as my primary cellphone soon, I'm also quite interested in this...

The NOLO-Bootloader was patched by the BootMenu project to boot a kernel directly from the mmc-card as well as providing a boot menu. I remember switching OSes for testing by simply replacing the mmc-card with another one containing another image or the backup of my main system. 
As the N900 wasn't locked down as those paranoid smartphones these days, getting it to initiate booting a new/'unknown' kernel shouldn't be that hard. Support for some of the exotic (and quite outdated) controllers used in the N900 will be the major problem IMHO.
If the neo900 project should finish development within this century, at least the hardware would be newer and better documented.

The bootmenu-project is still on maemo.org: https://garage.maemo.org/plugins/ggit/browse.php/?p=bootmenu


----------



## kpedersen (Oct 6, 2016)

plast0000 said:


> On N900, maybe, someone managed to run Darwin on it (the base of iOS and OS X) so you should be able to get FreeBSD running too.



FreeBSD and Darwin are different operating systems. Darwin happens to provide some FreeBSD userland and perhaps some network stack but other than that they are different. For one Darwin uses the Mach micro kernel whereas FreeBSD is entirely monolithic.

As for the iPhone. It would probably be easy if Apple had not unfortunately locked down the hardware so much and pretty much lobotomized it (and iOS). As things stand, it would probably be easier to get FreeBSD running on a block of wood.


----------



## goshanecr (May 27, 2017)

There is a interesting project in Linux world which goals is create fully working environment on smartphones, and on iPhone also. So maybe some of it's ideas will be adoptable for FreeBSD?
Project is https://ollieparanoid.github.io/post/postmarketOS/


----------

