How much linux is required for the phone to run?
#1
I'm sure I'm not the only one who wishes they can write their own OS

I've written code for an Arduino to communicate with a qualcomm chip/modem to receive and send SMS using AT commands. 
I wanted to try a from scratch for the raspberry pi but it seems like I'll get poor video performance because there's no documentation for using their GPU/video

I was wondering if there's a lot of linux that's required to get the phone running and if not would it be possible to write our own OS or embeded like as people may do for the Arduino?
  Reply
#2
Utilising the work already done to the mainline Linux kernel is the easiest way to achieve results.

If you can expand on your question, e.g. if you are primarily interested in developing user space or kernel space, I'm sure knowledgeable community members can steer you in the right direction.
  Reply
#3
(07-28-2020, 02:06 PM)overdrawnfettuccine Wrote: I'm sure I'm not the only one who wishes they can write their own OS

I've written code for an Arduino to communicate with a qualcomm chip/modem to receive and send SMS using AT commands. 
I wanted to try a from scratch for the raspberry pi but it seems like I'll get poor video performance because there's no documentation for using their GPU/video

I was wondering if there's a lot of linux that's required to get the phone running and if not would it be possible to write our own OS or embeded like as people may do for the Arduino?
You should definitely keep using the Linux kernel, but that is the only component you are strictly going to need. You could write an entire custom user space for the PinePhone if you really wanted to, although it will take you until you're old and gray. If you tried to rewrite everything that's needed to get phone calls working, the task really is just so monumental that I strongly suggest you don't bother trying at all.
  Reply
#4
(07-28-2020, 05:48 PM)Subsentient Wrote:
(07-28-2020, 02:06 PM)overdrawnfettuccine Wrote: I'm sure I'm not the only one who wishes they can write their own OS

I've written code for an Arduino to communicate with a qualcomm chip/modem to receive and send SMS using AT commands. 
I wanted to try a from scratch for the raspberry pi but it seems like I'll get poor video performance because there's no documentation for using their GPU/video

I was wondering if there's a lot of linux that's required to get the phone running and if not would it be possible to write our own OS or embeded like as people may do for the Arduino?
You should definitely keep using the Linux kernel, but that is the only component you are strictly going to need. You could write an entire custom user space for the PinePhone if you really wanted to, although it will take you until you're old and gray. If you tried to rewrite everything that's needed to get phone calls working, the task really is just so monumental that I strongly suggest you don't bother trying at all.

How sure are you about that? As the solo programmer I was able to check the status of the SIM card, connect to 4g cell towers, check the signal strength, receive text messages, react to them, store them on the phone, send text messages and pull up GPS information with GLONASS. I specifically remember using AT+CMGF and wondering why my PDU text is not correct and switching to text because it was suitable for our application. It's not too hard

https://sixfab.com/wp-content/uploads/20...l_V1.2.pdf
  Reply
#5
If you want to go low level, I wouldn't use Linux at all. I'd start out with Minix or NetBSD.
  Reply
#6
I guess what I'm asking is there some kind of pine library that covers the touch screen (screen and touch inputs), communication with the quectel chip (or that handles all thats necessary for calls and text), and hardware buttons or is it all done in linux and I'd have to go from scratch if I want to write a toy os?
  Reply
#7
(07-28-2020, 10:14 PM)overdrawnfettuccine Wrote: How sure are you about that? As the solo programmer I was able to check the status of the SIM card, connect to 4g cell towers, check the signal strength, receive text messages, react to them, store them on the phone, send text messages and pull up GPS information with GLONASS. I specifically remember using AT+CMGF and wondering why my PDU text is not correct and switching to text because it was suitable for our application. It's not too hard

The problem you'll have is getting the system to boot that far. Take a look at the device tree structure for Linux's implementation of the pinephone. This isn't an ATTiny85 where you can just fiddle registers directly and run on bare metal at kernel-level with almost no setup. For example, look at the U-Boot implementation, and that's just to get the kernel executed. U-Boot also has its own device tree implementation. ARM devices are a nightmare to get booted from ground zero and doing anything useful, just in general. If the PinePhone had ACPI/EFI it would be different.

I'm not saying it can't be done, but it's going to be a LOT more difficult than hacking on an arduino or ATMega AVR MCU, and even much more difficult than an x86 PC.

I have to ask, why would you want to go to all that trouble, when anything one man can write would be a vast underutilisation of the PinePhone's Cortex-A53 CPU? I run full desktop-grade XFCE and desktop Firefox etc on mine, and that's my daily driver.
  Reply
#8
(07-28-2020, 10:52 PM)KC9UDX Wrote: If you want to go low level, I wouldn't use Linux at all.  I'd start out with Minix or NetBSD.

(07-29-2020, 12:41 AM)Subsentient Wrote:
(07-28-2020, 10:14 PM)overdrawnfettuccine Wrote: How sure are you about that? As the solo programmer I was able to check the status of the SIM card, connect to 4g cell towers, check the signal strength, receive text messages, react to them, store them on the phone, send text messages and pull up GPS information with GLONASS. I specifically remember using AT+CMGF and wondering why my PDU text is not correct and switching to text because it was suitable for our application. It's not too hard

The problem you'll have is getting the system to boot that far. Take a look at the device tree structure for Linux's implementation of the pinephone. This isn't an ATTiny85 where you can just fiddle registers directly and run on bare metal at kernel-level with almost no setup. For example, look at the U-Boot implementation, and that's just to get the kernel executed. U-Boot also has its own device tree implementation. ARM devices are a nightmare to get booted from ground zero and doing anything useful, just in general. If the PinePhone had ACPI/EFI it would be different.

I'm not saying it can't be done, but it's going to be a LOT more difficult than hacking on an arduino or ATMega AVR MCU, and even much more difficult than an x86 PC.

I have to ask, why would you want to go to all that trouble, when anything one man can write would be a vast underutilisation of the PinePhone's Cortex-A53 CPU? I run full desktop-grade XFCE and desktop Firefox etc on mine, and that's my daily driver.

Oh I had no idea there were many hoops to jump through. I thought it'd be fun to program a device that only runs my code with a touchscreen and wifi
  Reply
#9
(07-29-2020, 01:24 AM)overdrawnfettuccine Wrote: Oh I had no idea there were many hoops to jump through. I thought it'd be fun to program a device that only runs my code with a touchscreen and wifi
Yeah it's depressing on ARM except in the server space where ACPI is starting to appear.

If you want that kind of barebones experience, I'd recommend moving up to raw AVR microcontrollers, like the ATTiny85, my favorite. They're a lot of fun, and they're bare metal entirely, no arduino board to baby you. Just 8K of ROM to put your compiled C into. You can get a row of around 10 of them for like $15, then you can fiddle with them however you like.

You could also consider getting into linux kernel driver development, knowledge which would be useful in both ARM and x86 spaces.
  Reply
#10
(07-29-2020, 10:29 PM)Subsentient Wrote:
(07-29-2020, 01:24 AM)overdrawnfettuccine Wrote: Oh I had no idea there were many hoops to jump through. I thought it'd be fun to program a device that only runs my code with a touchscreen and wifi
Yeah it's depressing on ARM except in the server space where ACPI is starting to appear.

If you want that kind of barebones experience, I'd recommend moving up to raw AVR microcontrollers, like the ATTiny85, my favorite. They're a lot of fun, and they're bare metal entirely, no arduino board to baby you. Just 8K of ROM to put your compiled C into. You can get a row of around 10 of them for like $15, then you can fiddle with them however you like.

You could also consider getting into linux kernel driver development, knowledge which would be useful in both ARM and x86 spaces.

How much boot/init knowledge is required? I absolutely would like a touchscreen and either wifi or a modem with 4g capabilities/SMS.
Would it have enough CPU power to run a basic rougelike game written in C at 60fps? Things simple enough that the nes/snes can do with pixels instead of tiles which make those consoles life easier
  Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How-To: Remote Control Your Phone from Desktop via VNC biketool 2 439 10-12-2024, 11:47 AM
Last Post: biketool
  Genode- Sculpt OS for the PinePhone (non Linux) Surehand53 1 1,608 11-04-2023, 07:23 PM
Last Post: tllim
  Article: NuttX RTOS for PinePhone: Feature Phone UI in LVGL, Zig and WebAssembly lupyuen 64 25,936 09-09-2023, 09:49 AM
Last Post: WhiteHexagon
  Article: NuttX RTOS for PinePhone: Phone Calls and Text Messages lupyuen 2 1,931 05-03-2023, 05:03 PM
Last Post: lupyuen
  Arch Linux on PinePhone Rocky-IV 4 10,690 12-21-2022, 04:35 AM
Last Post: gregb49
  Mepo - Minimalist and hackable OSM map viewer for mobile linux mil 22 17,933 10-31-2022, 07:29 AM
Last Post: mil
  [Stupid Question] Where is the phone camera software?! newusername 5 3,790 10-10-2022, 03:58 AM
Last Post: newusername
  Control HBIAS through a linux OS twiclo 0 1,232 10-04-2022, 03:20 PM
Last Post: twiclo
  difference between android and linux? vanja 3 2,739 09-16-2022, 07:43 PM
Last Post: TRS-80
  meet franz! (whatsapp,telegram,etc linux client) vanja 0 1,346 09-15-2022, 01:23 AM
Last Post: vanja

Forum Jump:


Users browsing this thread: 5 Guest(s)