User Tools

Site Tools


doc:appunti:hardware:samsung_galaxy_s4

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
doc:appunti:hardware:samsung_galaxy_s4 [2019/09/16 08:57] niccolodoc:appunti:hardware:samsung_galaxy_s4 [2019/09/16 13:38] – [Bootloader, baseband firmware, ROM, etc.] niccolo
Line 214: Line 214:
 L'errore è ovviamente comparso **dopo che avevamo fatto il wipe** delle partizioni di sistema, quindi **il telefono era totalmente inutilizzabile**. Per fortuna si riusciva ad avviare sia in **modalità download** che in **modalità recovery** con la combinazione dei tasti opportuna. In modalità download abbiamo aggiornato il bootloader (le partizioni **SBLx** e **ABOOT**) e visto che c'eravamo abbiamo aggiornato anche il firmware del modem e tutto il resto. L'errore è ovviamente comparso **dopo che avevamo fatto il wipe** delle partizioni di sistema, quindi **il telefono era totalmente inutilizzabile**. Per fortuna si riusciva ad avviare sia in **modalità download** che in **modalità recovery** con la combinazione dei tasti opportuna. In modalità download abbiamo aggiornato il bootloader (le partizioni **SBLx** e **ABOOT**) e visto che c'eravamo abbiamo aggiornato anche il firmware del modem e tutto il resto.
  
-==== Bootloader, baseband firmware ====+==== Bootloader, baseband firmware, ROM, etc. ====
  
-^ sbl1.mbn, sbl2.mbn, sbl3.mbn  | Secondary Boot Loader +Il sistema operativo (che nel mondo Android spesso viene chiamato col termine improprio e fuorviante di ROM) risiede in una propria partizione, generalmente formattata con un filesystem di tipo ext4 o analogo. Gli aggiornamenti oppure gli archivi per effettuare il restore alle condizioni di fabbrica contengono l'immagine di tale partizione (ad esempio **system.img.ext4**), ma contengono anche le immagini di altre partizioni necessarie al funzionamento. Spesso si sente parlare di **aggiornare il bootloader** e il **baseband** di uno smartphone. si tratta del contenuto di queste altre partizioni che spiegheremo qui sotto.  
-^ aboot.mbn     | Android Boot  | + 
-^ modem.bin     | Firmware per il modem 3G  | +Per approfondire il processo di boot di Android vedere **[[http://newandroidbook.com/Articles/aboot.html|Reverse Engineering Android's Aboot]]**. 
-^ NON-HLOS.bin Firmare per LTE, etc.  | + 
-boot.img      Kernel e ramdiskSi deve usare quello fornito dalla ROM (Sistema Operativo).  |+Per **baseband** si intende in genere il **firmware** che regola il **funzionamento dei dispositivi radio**, come il modem 3G, le comunicazioni cellulari voce e dati, il WiFi, Bluetooth, NFC, ecc. 
 + 
 +Ecco ad esempio il **contenuto della ROM stock** Android 5.0.1 con codici PDA I9515XXS1BPL2 e CSC I9515YXY1BOI1. I vari file sono elencati nell'ordine in cui vengono utilizzati al bootstrap. 
 + 
 +^ sbl1.mbn, sbl2.mbn, sbl3.mbn Images of the **Secondary Boot Loader**. They are loaded during bootstrap from the boot loader contained into the ROM (the real ROM, that is the read-only memory integrated into the chips). They provide add-ons that are not present in the very limited ROM. This is **the updatable part (flashable) of the bootloader**.  | 
 +^ aboot.mbn     **Android Boot** image. It is an ARM executable started by the Secondary Boot Loader, generally it must be //digitally signed// by the vendor, otherwise it is rejected by the SBL. The operating system may have special requirements with respect to these components, for example LineageOS 14.1 requires the SBL and Android Boot shipped with Android 5.0.1. 
 +^ boot.img      | Contains the image of the **kernel** and the **initial ramdisk**. This image should be the one provided by the installed operating system (ROM). Stock ROM 5.0.1 provides its own //boot.img//, LineageOS 14.1 has another. If the phone has an **unlocked boot loader**, it will be possible to load a **boot.img not digitally signed** by the vendor.  | 
 +^ modem.bin     | Firmware, probably fpr the **3G/LTE** modem (SMS, CSD, ETWS, 4GV, EVRC etc.).  | 
 +^ NON-HLOS.bin Firmware, probably for the **WiFI** radio device, WPA, etc. May be also for //SRS TruMedia// audio, etc. Those are functions not provided by the //High Level Operating Systems// (HLOS).  | 
 +rpm.mbn       | Support for **Resource Power Manager** by Qualcomm Technologies. 
 +^ tz.mbn        | Contains the **TrustZone** Board Support Package, to use the hardware-based security feature built into every modern ARM processor. 
 +^ recovery.img  This image is used when starting the phone in **recovery mode**In general it is preferable to flash an **alternative recovery such as TWRP** and not to use the //stock recovery// | 
 +^ system.img.ext4  | Main image of the Android 5.0.1 **operating system**. This is the biggest file, about 2 Gb.  | 
 +^ cache.img.ext4   
 +^ hidden.img.ext4  |
  
 ==== Procedura di aggiornamento ==== ==== Procedura di aggiornamento ====
Line 245: Line 259:
 Non è strettamente necessaio per l'installazione di LineageOS, ma abbiamo approfittato per passare da TWRP 3.0.3 a 3.3.1. L'aggiornamento di TWRP si è effettuato da TWRP stessa: Non è strettamente necessaio per l'installazione di LineageOS, ma abbiamo approfittato per passare da TWRP 3.0.3 a 3.3.1. L'aggiornamento di TWRP si è effettuato da TWRP stessa:
  
-  * Riavviato in modalità recovery con **adb reboot recovery** (comando da PC GNU/Linux).+  * Riavviato in **modalità recovery** con **adb reboot recovery** (comando da PC GNU/Linux).
   * TWRP 3.0.2 => Install => Install image => Browse to **recovery.img** and tap it.   * TWRP 3.0.2 => Install => Install image => Browse to **recovery.img** and tap it.
   * Select Partition to Flash Image: Recovery => **Swipe to confirm Flash** => Reboot System   * Select Partition to Flash Image: Recovery => **Swipe to confirm Flash** => Reboot System
Line 253: Line 267:
 Installare il pacchetto **heimdall** su un PC GNU/Linux. Installare il pacchetto **heimdall** su un PC GNU/Linux.
  
-  - Avviare in **modalità download**: spengere, quindi VolDown + Home + Power. Collegare il cavetto USB.+  - Avviare in **modalità download** da telefono spento premendo VolDown + Home + Power. Collegare il cavetto USB.
   - Dal PC GNU/Linux eseguire **heimdall detect** per verificare che il telefono sia riconosciuto.   - Dal PC GNU/Linux eseguire **heimdall detect** per verificare che il telefono sia riconosciuto.
-  - Effettuare il flash del boot loader e dei firmare: +  - Effettuare il **flash** del boot loader e dei firmare (richiede permessi di root sul PC):<code>
- +
-<code>+
 heimdall flash --SBL1 sbl1.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --ABOOT aboot.mbn \ heimdall flash --SBL1 sbl1.mbn --SBL2 sbl2.mbn --SBL3 sbl3.mbn --ABOOT aboot.mbn \
         --APNHLOS NON-HLOS.bin --MDM modem.bin \         --APNHLOS NON-HLOS.bin --MDM modem.bin \
-        --RPM rpm.mbn --TZ tz.mbn +        --RPM rpm.mbn --TZ tz.mbn</code>
-</code>+
  
-Ciò che è davvero necessario per LineageOS è aggiornare il boot loader (partizioni **SBx** e **ABOOT**), ma aggiornare gli altri firmware non fa male. Il progamma mostra l'avanzamento percentuale durante il flash di ogni partizione. Alla conclusione tenta un reboot (che dovrebbe fallire perché boot loader S.O. non corrispondono).+Ciò che è davvero necessario per LineageOS è aggiornare il boot loader (partizioni **SBLx** e **ABOOT**), ma aggiornare gli altri firmware non fa male. Il progamma mostra l'avanzamento percentuale durante il flash di ogni partizione. Alla conclusione tenta un reboot (che forse fallisce perché il boot loader è per Android 5.0.1, ma il nostro S.O. è ancora quello vecchio).
  
 === Installazione della ROM e delle Gapps === === Installazione della ROM e delle Gapps ===
doc/appunti/hardware/samsung_galaxy_s4.txt · Last modified: 2019/09/17 07:56 by niccolo