# FreeBSD for phone/tablet



## deadmorozz (May 12, 2020)

Hi,

I checked many different OS that are now popular, take a look at Sailfish, but none has similar feeling to FreeBSD. When it will work?


----------



## SirDice (May 12, 2020)

deadmorozz said:


> When it will work?


Tomorrow. Next week. Next year. Never. Who knows? Just look at the Raspberry Pi for example. The Pi4 still needs a lot of work, and that's supposed to be an "open" platform. Imagine how much work needs to be done for completely closed devices like phones or tablets. Without documentation, without schematics, without specifications, without  vendor support.


----------



## Alain De Vos (May 12, 2020)

Mobile devices are java oriented or objective-c ?


----------



## k3y5 (May 12, 2020)

This is something I would really like to get involved in (the development of a BSD OS for mobile). I'm currently skilling up on C in order to do so.


----------



## Menelkir (May 12, 2020)

Alain De Vos said:


> Mobile devices are java oriented or objective-c ?



IOS is Objective-C, Android is sort of a google-java-tuned.


----------



## deadmorozz (May 12, 2020)

Blackberry OS seems to be the most similar to what you would want


----------



## k3y5 (May 12, 2020)

deadmorozz said:


> Blackberry OS seems to be the most similar to what you would want



Nokia too.


----------



## George (May 12, 2020)

Maybe at some point we will see FreeBSD on a pinephone.


----------



## SirDice (May 12, 2020)

k3y5 said:


> This is something I would really like to get involved in (the development of a BSD OS for mobile).


As most (all?) of these devices run on an ARM variant you could start by looking at the various supported ARM boards (like a Pi for example).



			arm - FreeBSD Wiki


----------



## k3y5 (May 12, 2020)

SirDice said:


> As most (all?) of these devices run on an ARM variant you could start by looking at the various supported ARM boards (like a Pi for example).



Excellent idea, I'll start 
	

			arm - FreeBSD Wiki
		

 here. Thanks Dice!


----------



## k3y5 (May 12, 2020)

Now I know this is a BSD forum, but if anyone is looking for a good secure mobile. I would recommend Armadillo Phone (secure alternative) , but this may be a bit overkill for most. I've been very happy with them, and if you drop extra coin you can get a "ghost," chip. My company was nice enough to purchase one for me. They're pricy to say the least.


----------



## Hakaba (May 12, 2020)

As tablet / mobile is a larger market than desktop / laptop, we probably saw a FreeBSD tablet one day.
On a tablet, there is no real gui for file managment, all application has one window. The window is fullscreen...
That is an real oppotunity to have simplified interface...
On my laptop, I use neomutt in dwm and a sxiv script as a launcher. It is very light and there is only few fustration (keyboard shortcut are problematic in tablet).

For me, the first blocking point is the hardware. As I know, there is no tablet or mobile with a full hardware support (open source spec or drivers for linux/bsd).


----------



## Mishaparem (Aug 26, 2021)

Hakaba said:


> For me, the first blocking point is the hardware. As I know, there is no tablet or mobile with a full hardware support (open source spec or drivers for linux/bsd).


Yeah, even Ubuntu guys say porting Ubuntu to mobile is mostly a case of dealing with the proprietary drivers, and they're basically "porting" drivers from a Linux distro to a different Linux distro. (Can that even be called porting?) I'm digging around to see what I can do with my old tablet. The 10in screen which is still uncracked, plus the ridiculous battery life on an almost 10yo device really makes me want to revive it as a mobile platform for development while im in the train to work for example.


----------



## grahamperrin@ (Aug 27, 2021)

<https://potabi.com/>

The Plan for Potabi (2021-03-15)

In the Wayback Machine: The Detailed Explanation on WHY Potabi Is Halting Development. That's no longer at the blog, let's assume that the author was (understandably) having a bad day/week/month.


----------



## Beastie7 (Aug 27, 2021)

I’m afraid FreeBSD doesn’t have the facilities necessary for a mobile OS. It would simply not perform well.


----------



## George (Aug 28, 2021)

You can see how much work is needed by looking at pinephone development.

FreeBSD would need:
- graphics/ audio/ touchpad drivers
- a complete rewrite of a window manager, suitable to be used without mouse/keyboard.
- third party tools for touchpad only use
- Power/battery management, so that the smartphone doesn't run out of power after 4 hours
- Bugfixing/ finetuning for better user experience
- (cell-)phone apps + drivers
- many scripts
- camera app + driver
- hardware acceleration
- and so on..


----------



## astyle (Sep 1, 2021)

Just take a look at the architectures that 13-RELEASE supports! The download area provides images for Pine64, Pi-B, and a few others! FreeBSD is famous for working on BeagleBone SoC's, too! I'd suggest the following approach:

Figure out the architectures that 13-RELEASE even supports. You'll be surprised to no end!
Do some homework to see if your hardware is even on that list.
You may need to adjust your expectations based on the research above. A few options that I see:
(If hardware is in fact supported) Install FreeBSD anyway, just for different use cases than initially expected.
Install something else that is compatible, and has the features you want.
(If you enjoy the process) Figure out how to make a driver work on the device under FreeBSD, figure out how to maintain a port.


----------



## ondra_knezour (Sep 1, 2021)

astyle said:


> Figure out the architectures that 13-RELEASE even supports.


Then try to find any embedded GSM/GPRS/EDGE/4G/LTE/whatever chipset with FreeBSD drivers documentation available to write those drivers yourself. End of journey.


----------



## astyle (Sep 1, 2021)

ondra_knezour said:


> Then try to find any embedded GSM/GPRS/EDGE/4G/LTE/whatever chipset with FreeBSD drivers documentation available to write those drivers yourself. End of journey.


There's a difference between chipsets and antennae. All of the antennae you list are easily available as USB sticks. And, it really helps to know the technical terminology and precise meanings in use - you won't get anywhere without that. Beyond that, there's always Fast Fourier Transform - the same base algorithm that drives multimedia/ffmpeg... what do you think 'ff' in 'ffmpeg' stands for?


----------



## ondra_knezour (Sep 1, 2021)

Regarding terminology - plural form antennae is used exclusively for sensing protrusions on anthropods heads. For multiple passive devices used as interface between radio waves in space and electric currents in conductors plural term antennas is used. Now, when we have terminology right, I can only wish you good luck constructing FreeBSD phone using passive antenna connected through USB to your CPU, where you would try to apply FFT to random currents induced on your antenna or antennas to communicate with outside world. I see we have real wireless master here, so we can expect results in no time


----------



## ondra_knezour (Sep 1, 2021)

astyle said:


> what do you think 'ff' in 'ffmpeg' stands for?


We have such saying here - think something mean know [expletive].

FF stands for fast forward.


----------



## astyle (Sep 1, 2021)

I was just trying to be logical in the divide-and-conquer approach to the problem posed by the thread... That's the approach I'd be taking if I really wanted to get FreeBSD going on a phone or tablet. I have no expertise or interest in getting involved. I did read enough about Raspberry Pi and BeagleBone to realize that I can pull it off if I put my mind to it, I'm logical enough for that, and I'd be able to identify holes in my knowledge.


----------



## bsduck (Sep 1, 2021)

ondra_knezour said:


> Regarding terminology - plural form antennae is used *exclusively* for sensing protrusions on anthropods heads. For multiple passive devices used as interface between radio waves in space and electric currents in conductors plural term antennas is used.


If this really matters to you, reality seems to be somewhat more nuanced: https://en.wiktionary.org/wiki/antenna#Usage_notes

I personnally think the oddities of the English language are not among the most essential things to master.


----------



## astyle (Sep 1, 2021)

bsduck said:


> I personnally think the oddities of the English language are not among the most essential things to master.


Maybe so, but it's entertaining as hell, especially when you have a second or third language to translate that to, and be able to poke fun at people


----------



## ondra_knezour (Sep 1, 2021)

astyle - That is important difference. You of course can run FreeBSD on those single board computers, attach some touch screen, connect to the WiFi or cellular network using ad-on cards, USB devices etc., but it would be "only" discovery/educational/fun endeavor for person(s) involved. When you want something practically useful as phone or tablet, you either have to construct it yourself (like for example Pine does) or reuse HW already on the market like for example custom Android ROMs do. Both ways have major roadblock at the start - most of the functions of such device is performed by one or two chips for which documentation is not freely available, you have to sign NDA, do orders in tens of thousands etc. Even then you never know what you will get. You may end with something really well documented, but pricey and not always doing everything you would like or something relative cheap, with many bells and whistles, but documentation is really *** and HW too. If you are lucky, most of the docs would say something like "there was error in xxx, fixed in HW revision xy, fixed again in xz and finally hopefully fixed in yz". If you are not, there would not be any revisions and their documentation neither. Both  "lucky" cases from personal experience (with TI and Mediatek).


----------



## grahamperrin@ (Sep 1, 2021)

From the current _Desktop/Wireless_ edition of *FreeBSD Journal* (July/August 2021):

The Panfrost Driver (PDF) | <https://issue.freebsdfoundation.org/publication/?m=33057&i=719022&p=21&ver=html5>



> *The mature operating system and the new graphics driver for the arm64 platform gets us ready to run FreeBSD on high-end server/desktop systems, research-platforms, embedded environments, or even current smartphones/personal devices*


----------



## astyle (Sep 2, 2021)

ondra_knezour said:


> When you want something practically useful as phone or tablet, you either have to construct it yourself (like for example Pine does) or reuse HW already on the market like for example custom Android ROMs do. Both ways have major roadblock at the start - most of the functions of such device is performed by one or two chips for which documentation is not freely available, you have to sign NDA, do orders in tens of thousands etc.


I'd frankly challenge you to define 'practically useful'. Something for yourself or for someone else? If I'm doing something for myself, I don't mind putting in the effort and then living with imperfections. It's *my* homebrew project, after all. If I'm doing it for someone else - it would be on request of that someone else, and with knowledge that they're willing to live with the imperfections as well. The alternative to doing it yourself is to buy something commercially available.


----------



## ondra_knezour (Sep 2, 2021)

astyle said:


> I'd frankly challenge you to define 'practically useful'. [...]It's *my* homebrew project, after all.


This was covered by the  _"only" discovery/educational/fun endeavor for person(s) involved_ part. In regards of my understanding of practically useful in the light of FreeBSD on the phone discussion you can imagine something what is working and known on the market, for example Jolla/Sailfish or PalmOS resurrection. The first one is delivering (with hiccups), second one died and ended as Smart TV OS. I really wished them both succeed. But both delivered something what regular person may want to buy, even if that was niche product.


----------



## Mishaparem (Sep 15, 2021)

astyle said:


> Just take a look at the architectures that 13-RELEASE supports! The download area provides images for Pine64, Pi-B, and a few others! FreeBSD is famous for working on BeagleBone SoC's, too! I'd suggest the following approach:
> 
> Figure out the architectures that 13-RELEASE even supports. You'll be surprised to no end!
> Do some homework to see if your hardware is even on that list.
> ...


I already checked - my SoC is supported. The first step, I guess is to compile BSD for my SoC. Next step is to focus on the drivers, but the question is - drivers for android are still C, so shouldn't it be possible to rip them out of the OEM android rom and splice them into BSD? It's not ideal, but I'm thinking along the lines of a linux kernel compat layer for the bsd kernel... is such a thing possible?

The problem with writing your own drivers for devices used on an android device, is that most of the drivers are proprietary and lack documentation, same goes for the devices themselves.

I suppose it might be possible to decompile into assembler and try to RE them for BSD, but..


----------



## SirDice (Sep 15, 2021)

Mishaparem said:


> Next step is to focus on the drivers, but the question is - drivers for android are still C, so shouldn't it be possible to rip them out of the OEM android rom and splice them into BSD?


Just because they've been written in C doesn't mean it'll work. The kernel interfaces of the Android (Linux) and FreeBSD kernels are completely different.


Mishaparem said:


> but I'm thinking along the lines of a linux kernel compat layer for the bsd kernel... is such a thing possible?


Yes, no, sort of. 


Mishaparem said:


> The problem with writing your own drivers for devices used on an android device, is that most of the drivers are proprietary and lack documentation, same goes for the devices themselves.


And that's the reason why FreeBSD is lacking a lot of those drivers.


----------



## astyle (Sep 15, 2021)

Mishaparem said:


> Next step is to focus on the drivers, but the question is - drivers for android are still C, so shouldn't it be possible to rip them out of the OEM android rom and splice them into BSD? It's not ideal, but I'm thinking along the lines of a linux kernel compat layer for the bsd kernel... is such a thing possible?


I'd first check to see if the defaults even work. FreeBSD does provide a few pre-made drivers. Take a look at boot logs - what hardware does the kernel even 'see' ? If you don't have a driver included by default, it may be possible to hunt something down - just ask around on these forums. Writing your own driver would be really a last resort. You can start looking here for some guidance on how to write a driver for a FreeBSD-based SoC. Usually, SoC's are very simple devices with just USB ports for input. 

If you enjoy the process, you're more than welcome to try and port an Android device driver (although I think you'll probably just use it as a *template* to write a FreeBSD-compatible device driver from ground up, rather than copy-paste any C code). FWIW, this is more that I'd be willing to take on, but this is something that's fun to watch from the sidelines.


----------



## teo (Sep 27, 2021)

astyle said:


> I'd first check to see if the defaults even work. FreeBSD does provide a few pre-made drivers. Take a look at boot logs - what hardware does the kernel even 'see' ? If you don't have a driver included by default, it may be possible to hunt something down - just ask around on these forums. Writing your own driver would be really a last resort. You can start looking here for some guidance on how to write a driver for a FreeBSD-based SoC. Usually, SoC's are very simple devices with just USB ports for input.
> 
> If you enjoy the process, you're more than welcome to try and port an Android device driver (although I think you'll probably just use it as a *template* to write a FreeBSD-compatible device driver from ground up, rather than copy-paste any C code). FWIW, this is more that I'd be willing to take on, but this is something that's fun to watch from the sidelines.


The  driver for Huawei do it ?


----------



## neimsaci (Aug 10, 2022)

How about cooperation? There is few projects that gone pretty far: https://pyra-handheld.com/boards/pages/pyra/ | https://www.crowdsupply.com/sutajio-kosagi/precursor | https://neo900.org


----------

