bootloader – How to debug the kernel if the device only boot to fastboot

I am tring to compile the kernel source provided by the manufacture of my phone(OPPO PCCM00 precisely). Since it’s not “well-opensourced”, I changed quite a lot to make sure the kernel would compile without any errors.
However when I tried to boot the device after fastboot flash boot boot.img, the device only comes to fastboot.
I tried pull the dmesg out with TWRP developed by another owner and it goes like this.

<6>(    0.000000)  (0)(0:swapper)Booting Linux on physical CPU 0x0
<5>(    0.000000)  (0)(0:swapper)Linux version 4.14.117-perf+ (root@cp-ubuntu-123-78) (clang version 8.0.12 for Android NDK) #2 SMP PREEMPT Thu Mar 5 03:47:08 CST 2020
<6>(    0.000000)  (0)(0:swapper)Boot CPU: AArch64 Processor (51df805e)
<6>(    0.000000)  (0)(0:swapper)Machine: Qualcomm Technologies, Inc. SM8150 V2 PM8150 MTP
<6>(    0.000000)  (0)(0:swapper)earlycon: msm_geni_serial0 at MMIO 0x0000000000a90000 (options '')
<6>(    0.000000)  (0)(0:swapper)bootconsole (msm_geni_serial0) enabled
<3>(    0.000000)  (0)(0:swapper)OF: reserved mem: OVERLAP DETECTED!
<3>(    0.000000) disp_rdump_region (0x000000009c000000--0x000000009e400000) overlaps with cont_splash_region (0x000000009c000000--0x000000009e400000)
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000ff400000, size 8 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node sp_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000fe400000, size 16 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node user_contig_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x000000027dc00000, size 36 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node mem_dump_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000fbc00000, size 40 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000f6000000, size 92 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node secure_display_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000f5000000, size 16 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node qseecom_ta_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000f4000000, size 16 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node adsp_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created CMA memory pool at 0x00000000f3c00000, size 4 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node cdsp_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x000000008b700000, size 5 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node camera_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x000000008bc00000, size 1 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_wlan_fw_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x000000008bd80000, size 0 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_npu_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x000000008be00000, size 30 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_adsp_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x000000008dc00000, size 160 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node modem_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000097c00000, size 5 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_video_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000098100000, size 20 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_slpi_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000099500000, size 0 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_ipa_fw_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000099510000, size 0 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_ipa_gsi_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000099515000, size 0 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_gpu_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000099600000, size 1 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node pil_spss_region, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x0000000099700000, size 20 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node cdsp_regions, compatible id removed-dma-pool
<6>(    0.000000)  (0)(0:swapper)Reserved memory: created DMA memory pool at 0x000000009e400000, size 20 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node qseecom_region, compatible id shared-dma-pool
<6>(    0.000000)  (0)(0:swapper)Removed memory: created DMA memory pool at 0x00000000a4c00000, size 12 MiB
<6>(    0.000000)  (0)(0:swapper)OF: reserved mem: initialized node cdsp_sec_regions, compatible id removed-dma-pool

I couldn’t find any thing useful because it looks so much like the prebuilt kernel extracted from stock firmware, there is no kernel panic and I found and the timestamp in the second line does not seem to be right.
My wild guess is that I am not debugging it in the right way, the actual log for my compiled kernel is flushed when it boots to recovery or the system.

So is there any advice for me the to debug the kernel without booting to other environment?
I really apperciate your help.
the kernel source can be found here

Kernel crashes on invoking Python prompt

Apologies if this is a naive question. A typing error keeps crashing the kernel.
My typing error is to start a line with “>”, unintentionally invoking Python. The problem is that this crashes the kernel.
Is this a bug? Is there any way to disable the invocation of Python so that my clumsy typing doesn’t lead to crashes? I’m running Mathematica 12.2.0.0 on Mac OSX Mojave (10.14.6).

big sur – Macbook 16 Intel i9. Big Sur keep rebooting randomly due kernel panic

I’ve tried the usual troubleshooting steps (Reset NVRAM, SMC, Safe Boot), but still having the same issue.

 Machine-check capabilities: 0x0000000000000c0e
     family: 6 model: 158 stepping: 13 microcode: 222
     signature: 0x906ed
     Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
     14 error-reporting banks
    Processor 14: IA32_MCG_STATUS: 0x0000000000000005
     IA32_MC3_STATUS(0x40d): 0xfe40020000200135
     IA32_MC3_ADDR(0x40e):   0x0000000018ca6fe0
     IA32_MC3_MISC(0x40f):   0x0000000000702285
    Processor 15: IA32_MCG_STATUS: 0x0000000000000005
     IA32_MC3_STATUS(0x40d): 0xfe40020000200135
     IA32_MC3_ADDR(0x40e):   0x0000000018ca6fe0
     IA32_MC3_MISC(0x40f):   0x0000000000702285
    mp_kdp_enter() timed-out on cpu 3, NMI-ing
    mp_kdp_enter() NMI pending on cpus: 0 1 2 4 5 6 7 8 9 10 11 12 13 14 15
    mp_kdp_enter() timed-out during locked wait after NMI;expected 16 acks but received 1 after 10524352 loops in 1152000000 ticks
    panic(cpu 3 caller 0xffffff8017fedd19): "Machine Check at 0xffffff8018000af9, registers:n" "CR0: 0x000000008001003b, CR2: 0x00007f0294000010, CR3: 0x000000002bf95000, CR4: 0x00000000003626e0n" "RAX: 0x0000000000000060, RBX: 0x0000000000000017, RCX: 0x0000000000000001, RDX: 0x0000000000000000n" "RSP: 0xffffffb0e1603ef0, RBP: 0xffffffb0e1603f20, RSI: 0xffffff8018ddef40, RDI: 0xffffff8018c504b0n" "R8:  0x0000000000000001, R9:  0x0000000000000010, R10: 0x0000000000000001, R11: 0x0000000000000001n" "R12: 0x0000000000000060, R13: 0x000000001123d199, R14: 0x00002f902a3ed570, R15: 0x0000000000000003n" "RFL: 0x0000000000000046, RIP: 0xffffff8018000af9, CS:  0x0000000000000008, SS:  0x0000000000000000n" "Error code: 0x0000000000000000n"@/AppleInternal/BuildRoot/Library/Caches/com.apple.xbs/Sources/xnu/xnu-7195.60.75/osfmk/i386/trap_native.c:168
    Backtrace (CPU 3), Frame : Return Address
    0xffffff8017d57ad0 : 0xffffff8017eb9aed 
    0xffffff8017d57b20 : 0xffffff8017ffc6e3 
    0xffffff8017d57b60 : 0xffffff8017fecd1a 
    0xffffff8017d57bb0 : 0xffffff8017e5ea2f 
    0xffffff8017d57bd0 : 0xffffff8017eb938d 
    0xffffff8017d57cf0 : 0xffffff8017eb9678 
    0xffffff8017d57d60 : 0xffffff80186be3ca 
    0xffffff8017d57dd0 : 0xffffff8017fedd19 
    0xffffff8017d57ec0 : 0xffffff80186bedf5 
    0xffffff8017d57ed0 : 0xffffff8017e5f28f 
    0xffffffb0e1603f20 : 0xffffff8017fef0a2 
    0xffffffb0e1603f40 : 0xffffff8017ee1119 
    0xffffffb0e1603f80 : 0xffffff8017ee12e8 
    0xffffffb0e1603fa0 : 0xffffff8017e5e13e 
    
    Process name corresponding to current thread: kernel_task
    Boot args: chunklist-security-epoch=0 -chunklist-no-rev2-dev chunklist-security-epoch=0 -chunklist-no-rev2-dev
    
    Mac OS version:
    20C69
    
    Kernel version:
    Darwin Kernel Version 20.2.0: Wed Dec  2 20:39:59 PST 2020; root:xnu-7195.60.75~1/RELEASE_X86_64
    Kernel UUID: 82E2050C-5936-3D24-AD3B-EC4EC5C09E11
    KernelCache slide: 0x0000000017c00000
    KernelCache base:  0xffffff8017e00000
    Kernel slide:      0x0000000017c10000
    Kernel text base:  0xffffff8017e10000
    __HIB  text base: 0xffffff8017d00000
    System model name: MacBookPro16,1 (Mac-E1008331FDC96864)
    System shutdown begun: NO
    Hibernation exit count: 0
    
    System uptime in nanoseconds: 52297237065495
    Last Sleep:           absolute           base_tsc          base_nano
      Uptime  : 0x00002f90663d4e0b
      Sleep   : 0x00002efaa85068d4 0x0000eac82c8e4032 0x00002eee2aaf8989
      Wake    : 0x00002efabbc7b71e 0x000114a612957668 0x00002efab9fbb382
    last started kext at 51491824437451: >usb.IOUSBHostHIDDevice    1.2 (addr 0xffffff801adad000, size 40960)
    last stopped kext at 51813744623940: >usb.!UUserHCI 1 (addr 0xffffff7fb879d000, size 98304)
    loaded kexts:
    >!ATopCaseHIDEventDriver    4020.6
    >!AHIDALSService    1
    >!APlatformEnabler  2.7.0d0
    >AGPM   119
    >X86PlatformShim    1.0.0
    @filesystems.autofs 3.0
    >!AUpstreamUserClient   3.6.8
    @kext.AMDRadeonX6000    4.0.2
    @fileutil   20.036.15
    @kext.AMDRadeonServiceManager   4.0.2
    >!A!IKBLGraphics    16.0.1
    >!A!IPCHPMC 2.0.1
    >!AGraphicsDevicePolicy 6.2.2
    >!AGFXHDA   100.1.431
    >BridgeAudioCommunication   100.2
    >!AAVEBridge    6.1
    >!AMuxControl2  6.2.2
    @AGDCPluginDisplayMetrics   6.2.2
    >!A!ICFLGraphicsFramebuffer 16.0.1
    >pmtelemetry    1
    >LuaHardwareAccess  1.0.16
    |IOUserEthernet 1.0.1
    |IO!BSerialManager  8.0.2f9
    @Dont_Steal_Mac_OS_X    7.0.0
    >!AHV   1
    >!ADiskImages2  1
    >!A!ISlowAdaptiveClocking   4.0.0
    >!AThunderboltIP    4.0.3
    >!ABridgeAudio!C    100.2
    >AGDCBacklightControl   6.2.2
    >!AMCCSControl  1.14
    >BCMWLANFirmware4378.Hashstore  1
    >BCMWLANFirmware4377.Hashstore  1
    >BCMWLANFirmware4364.Hashstore  1
    >BCMWLANFirmware4355.Hashstore  1
    >!ABCMWLANBusInterfacePCIeMac   1
    @filesystems.tmpfs  1
    @filesystems.hfs.kext   556.60.1
    @BootCache  40
    @!AFSCompression.!AFSCompressionTypeZlib    1.0.0
    @!AFSCompression.!AFSCompressionTypeDataless    1.0.0d1
    @filesystems.apfs   1677.60.23
    @private.KextAudit  1.0
    >!ASmartBatteryManager  161.0.0
    >!AACPIButtons  6.1
    >!ASMBIOS   2.1
    >!AACPIEC   6.1
    >!AAPIC 1.7
    @!ASystemPolicy 2.0.0
    @nke.applicationfirewall    310
    |IOKitRegistryCompatibility 1
    |EndpointSecurity   1
    >!AHIDKeyboard  222
    >!AHS!BDriver   4020.6
    >IO!BHIDDriver  8.0.2f9
    >!AActuatorDriver   4400.28
    >!AMultitouchDriver 4400.28
    >!AInputDeviceSupport   4400.35
    @kext.triggers  1.0
    @kext.AMDRadeonX6100HWLibs  1.0
    |IO!BHost!CUARTTransport    8.0.2f9
    |IO!BHost!CTransport    8.0.2f9
    @kext.AMDRadeonX6000Framebuffer 4.0.2
    @kext.AMDSupport    4.0.2
    @kext.AMDRadeonX6000HWServices  4.0.2
    >X86PlatformPlugin  1.0.0
    >IOPlatformPlugin!F 6.0.0d8
    >!A!ILpssUARTv1 3.0.60
    >!A!ILpssUARTCommon 3.0.60
    >!AOnboardSerial    1.0
    >!AGraphicsControl  6.2.2
    |IOAccelerator!F2   439.52
    |IOAVB!F    900.12
    @plugin.IOgPTPPlugin    900.11
    |IOEthernetAVB!C    1.1.0
    @!AGPUWrangler  6.2.2
    |IOSlowAdaptiveClocking!F   1.0.0
    |IOAudio!F  300.6.1
    @vecLib.kext    1.2.0
    @!AGraphicsDeviceControl    6.2.2
    >!ABacklightExpert  1.1.0
    |IONDRVSupport  585
    |IOGraphics!F   585
    >!ASMBus!C  1.0.18d1
    >usb.cdc.ncm    5.0.0
    >usb.cdc    5.0.0
    >usb.networking 5.0.0
    >usb.!UHostCompositeDevice  1.2
    >!ABCMWLANCoreMac   1.0.0
    |IOSerial!F 11
    |IO80211!FV2    1200.12.2b1
    >IOImageLoader  1.0.0
    >corecapture    1.0.4
    >!AThunderboltPCIDownAdapter    4.1.1
    >!AThunderboltDPInAdapter   8.1.4
    >!AThunderboltDPAdapter!F   8.1.4
    >!AHPM  3.4.4
    >!A!ILpssI2C!C  3.0.60
    >!A!ILpssI2C    3.0.60
    >!A!ILpssDmac   3.0.60
    >!ABSDKextStarter   3
    |IOSurface  289.3
    |IOSkywalk!F    1
    >mDNSOffloadUserClient  1.0.1b8
    @filesystems.hfs.encodings.kext 1
    >usb.!UVHCIBCE  1.2
    >usb.!UVHCICommonBCE    1.0
    >usb.!UVHCI 1.2
    >usb.!UVHCICommon   1.0
    >!AEffaceableNOR    1.0
    |IOBufferCopy!C 1.1.0
    |IOBufferCopyEngine!F   1
    |IONVMe!F   2.1.0
    >!AThunderboltNHI   7.2.8
    |IOThunderbolt!F    9.3.2
    |IOUSB!F    900.4.2
    >usb.!UXHCIPCI  1.2
    >usb.!UXHCI 1.2
    >!AEFINVRAM 2.1
    >!AEFIRuntime   2.1
    >!ASMCRTC   1.0
    |IOSMBus!F  1.1
    |IOHID!F    2.0.0
    $!AImage4   3.0.0
    |IOTimeSync!F   900.11
    |IONetworking!F 3.4
    >DiskImages 493.0.0
    |IO!B!F 8.0.2f9
    |IOReport!F 47
    |IO!BPacketLogger   8.0.2f9
    $quarantine 4
    $sandbox    300.0
    @kext.!AMatch   1.0.0d1
    |CoreAnalytics!F    1
    >!ASSE  1.0
    >!AKeyStore 2
    >!UTDM  511.60.2
    |IOUSBMass!SDriver  184.40.6
    |IOSCSIBlockCommandsDevice  436.40.6
    |IO!S!F 2.1
    |IOSCSIArchitectureModel!F  436.40.6
    >!AMobileFileIntegrity  1.0.5
    @kext.CoreTrust 1
    >!AFDEKeyStore  28.30
    >!AEffaceable!S 1.0
    >!ACredentialManager    1.0
    >KernelRelayHost    1
    |IOUSBHost!F    1.2
    >!UHostMergeProperties  1.2
    >usb.!UCommon   1.0
    >!ABusPower!C   1.0
    >!ASEPManager   1.0.1
    >IOSlaveProcessor   1
    >!AACPIPlatform 6.1
    >!ASMC  3.1.9
    |IOPCI!F    2.9
    |IOACPI!F   1.4
    >watchdog   1
    @kec.pthread    1
    @kec.corecrypto 11.1
    @kec.Libm   1

remote access – Kernel failing to connect to the frontend

I’ve been using Sakra’s tunnel https://github.com/sakra to try to connect my mathematica in Linux to the server of my university.
The problem being that even though the SSH connection works well in the terminal, Mathematica seems to get

The kernel … failed to connect to the front end. (Error =
MLECONNECT) . You should try running the kernel connection outside the
front end.

I’ve set it up so I don’t need to insert the password in the terminal so that shouldn’t be a problem.
Anyone knows what could cause this problem?

networking – How can I fix Broadcom driver Wifi with 5.8.0-xx kernel on Ubuntu 20.04

Just updated Ubuntu 20.04, restarted the computer and my Wifi adapter went MIA in the process:

Settings > Wi-Fi

No Wi-Fi Adapter Found

That’s OK. I can run this magical command and everything should work fine:

sudo apt-get install --reinstall bcmwl-kernel-source

But, I get these series of errors:

Loading new bcmwl-6.30.223.271+bdcom DKMS files...
Building for 5.8.0-34-generic
Building for architecture x86_64
Building initial module for 5.8.0-34-generic
ERROR: Cannot create report: (Errno 17) File exists: '/var/crash/bcmwl-kernel-source.0.crash'
Error! Bad return status for module build on kernel: 5.8.0-34-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.271+bdcom/build/make.log for more information.
dpkg: error processing package bcmwl-kernel-source (--configure):
 installed bcmwl-kernel-source package post-installation script subprocess returned error exit status 10
Errors were encountered while processing:
 bcmwl-kernel-source
E: Sub-process /usr/bin/dpkg returned an error code (1)

What do I do to get my wifi adapter back? Bonus points if you can explain what happened.

kernel – 20.04 LTS, today it asked me to update to 5.8.0.34 from 5.4.0.59 and it broke LSI 2116

Not sure why just today, after months of running on 20.04 LTS, it asked me to update to 5.8.0.34. But anyway, I did, rebooted, and never saw any of the disks attached to an LSI 2116 controller any more. Poked around, decided to reboot into 5.4.0.59 and it worked fine, disks there. In case of a one time glitch, went back to 5.8, and, no disks. Couldn’t find a way to make them appear. So, now I have removed HWE (again not sure why just now asked me to update, did not intentionally install it). But don’t know why that kernel won’t see disks attached to the LSI, surely that controller would still be supported?

Is Exit (no square brackets) equivalent to Quit[] for refreshing the Kernel from within an Evaluation Notebook?

I prefer to use Exit as it conveniently requires fewer key presses over Quit[]. But before I use it regularly I need to know if there any subtle differences between Quit[] and Exit. The Wolfram documentation pages for Quit and Exit appear to be very similar and even call these two functions synonymous but I just need to be sure.

Thanks.

16.04 – C Kernel in Jupyter Notebook not working

I set up Jupyter Notebook on a server and added a number of Kernels to be able to work not just in Python. All work apart from C. Even a simple test script like below does nothing.

#include <stdio.>
#include <math.h>

int main()
{
    printf("sqrt(67) = %f", sqrt(67));
    
    return 0;
}

To set up the C Kernel I followed the (simple) Manual instructions here.

The Manual Installation instructions here does not work.

Any guidelines appreciated.

Thanks.

……and a Happy, safe 2021 to all.