CN106227653A - A kind of linux kernel debugging system and method - Google Patents

A kind of linux kernel debugging system and method Download PDF

Info

Publication number
CN106227653A
CN106227653A CN201610551621.8A CN201610551621A CN106227653A CN 106227653 A CN106227653 A CN 106227653A CN 201610551621 A CN201610551621 A CN 201610551621A CN 106227653 A CN106227653 A CN 106227653A
Authority
CN
China
Prior art keywords
instruction
debugging
network interface
machine
type information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201610551621.8A
Other languages
Chinese (zh)
Other versions
CN106227653B (en
Inventor
周毅
程石林
陆暤冉
刘上
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuxi City Is With Core Heng Tong Science And Technology Ltd
Original Assignee
Wuxi City Is With Core Heng Tong Science And Technology Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuxi City Is With Core Heng Tong Science And Technology Ltd filed Critical Wuxi City Is With Core Heng Tong Science And Technology Ltd
Priority to CN201610551621.8A priority Critical patent/CN106227653B/en
Publication of CN106227653A publication Critical patent/CN106227653A/en
Application granted granted Critical
Publication of CN106227653B publication Critical patent/CN106227653B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The open a kind of linux kernel debugging system and method for the present invention, described method comprises the steps: that the client of debugging machine sends the instruction reading kernel type information;Described instruction is sent to target machine by the network interface of debugging machine;The network interface of target machine receives instruction;Baseboard management controller controls central processing unit by self-defined bus after resolving instruction and reads kernel type information from the static buffer of internal memory;Baseboard management controller sends described kernel type information;Described kernel type information is sent to debugging machine by the network interface of target machine;The client of debugging machine receives kernel type information by network interface, and is shown on interface.The present invention efficiently solves cannot be by the problem of printk debugging linux kernel during os starting.

Description

A kind of linux kernel debugging system and method
Technical field
The present invention relates to linux kernel debugging technique field, particularly relate to a kind of linux kernel debugging system and method.
Background technology
Linux inherits the Unix design philosophy with network as core, is the multiple-user network operation of a stable performance System.Linux kernel is a Monolithic Kernel system.Kernel refers to one and provides hardware abstraction layer, disk and file system The systems soft ware of the functions such as system control, multitask.Along with embedded device is more and more universal, a lot of functions are all in Linux The internal exploitation of core, i.e. the code of functional realiey is integrated in inside linux kernel, unreal at User space as application program Existing, thus cannot be convenient to use the debugging acids such as GDB and remove debugging location application program running state.At present, debugging Linux Kernel main method has printk ,/proc and kgdb etc., most common of which printk.Printk is to run in kernel The function to control station output display, linux kernel first kernel spacing distribute a static buffer, as display use Space, then call sprintf, format display character string, finally call tty_write and carry out the aobvious of information to terminal Show.But different operating system has different effect, such as, write a hello word kernel module, use this Content not necessarily can be shown in terminal by function, but one is scheduled in kernel buffers, it is possible to use " dmesg " order is checked Effect.But linux kernel is in the middle of the process started, if running into mistake and coming to a halt or collapse, will be unable to pass through The type information of kernel printk is checked in " dmesg " order.Kernel cannot be debugged in this case by printk.
Summary of the invention
It is an object of the invention to, by a kind of linux kernel debugging system and method, solve background above technology department Divide the problem mentioned.
For reaching this purpose, the present invention by the following technical solutions:
A kind of linux kernel debugging system, it includes debugging machine and target machine;Described debugging machine includes but not limited to client End and network interface;Described target machine includes but not limited to network interface, baseboard management controller (BMC), central processing unit (CPU) and interior Deposit;Described debugging machine realizes data between the two with target machine by respective network interface and transmits.
The invention also discloses a kind of linux kernel adjustment method based on said system, comprise the steps:
S101, the client of debugging machine send the instruction reading kernel type information;
S102, described instruction are sent to target machine by the network interface of debugging machine;
S103, the network interface of target machine receive instruction;
S104, baseboard management controller control the central processing unit static state from internal memory by self-defined bus after resolving instruction Kernel type information is read in relief area;
S105, baseboard management controller send described kernel type information;
S106, described kernel type information are sent to debugging machine by the network interface of target machine;
S107, the client of debugging machine receive kernel type information by network interface, and are shown on interface.
Especially, in described step S104, the structure of instruction includes but not limited to: Head: labeling head;Body Size: disappear Breath body length;Command: instruction;Sequence: instruction sequence number;Version: protocol version;Check Code: head school code; Body: message body.
Especially, in described step S104, the process of baseboard management controller parsing instruction specifically includes: one, substrate management Controller reads instruction from the network interface of target machine;Two, head mark Head of instruction is found;Three, judge whether to find head mark Note Head, if not finding, then returns and performs step one, otherwise perform step 4;Four, the whole head of instruction is read;Five, read Check code;Six, judging whether that verification is passed through, passing through if not verifying, then return and perform step one, otherwise perform step 7;Seven, root Message body Body is read according to the message body length Body Size of instruction;Eight, carry out according to instruction Command and message body Body Corresponding operating.
The linux kernel debugging system and method that the present invention proposes efficiently solves cannot during os starting Problem by printk debugging linux kernel.
Accompanying drawing explanation
The linux kernel debugging system structure schematic diagram that Fig. 1 provides for the embodiment of the present invention;
The linux kernel adjustment method flow process that Fig. 2 provides for the embodiment of the present invention;
The organigram of the instruction that Fig. 3 provides for the embodiment of the present invention;
Fig. 4 resolves the particular flow sheet of instruction for the baseboard management controller that the embodiment of the present invention provides.
Detailed description of the invention
For the ease of understanding the present invention, below with reference to relevant drawings, the present invention is described more fully.In accompanying drawing Give presently preferred embodiments of the present invention.But, the present invention can realize in many different forms, however it is not limited to institute herein The embodiment described.On the contrary, provide the purpose of these embodiments be make to the disclosure understand more thorough Comprehensively.It should be noted that unless otherwise defined, all of technology used herein and scientific terminology with belong to the present invention's The implication that those skilled in the art are generally understood that is identical.The term used the most in the description of the invention is simply In order to describe the purpose of specific embodiment, it is not intended that in limiting the present invention.Term as used herein " and/or " include one Individual or the arbitrary and all of combination of multiple relevant Listed Items.
Refer to shown in Fig. 1, the linux kernel debugging system structure schematic diagram that Fig. 1 provides for the embodiment of the present invention.
In the present embodiment, linux kernel debugging system specifically includes debugging machine 101 and target machine 102;Described debugging machine 101 Include but not limited to client 1011 and network interface 1012;Described target machine 102 includes but not limited to the management control of network interface 1021, substrate Device 1022 processed, central processing unit 1023 and internal memory 1024;Described debugging machine 101 is realized by respective network interface with target machine 102 Data transmission between the two.Wherein, described baseboard management controller (Baseboard Management Controller, BMC) Support the IPMI specification of industry standard;This specification describes the management function being built on mainboard;These functions include: this Ground and remotely diagnosis, control station support, configuration management, hardware management and failture evacuation.
As in figure 2 it is shown, the linux kernel adjustment method flow process that Fig. 2 provides for the embodiment of the present invention.
In the present embodiment, linux kernel adjustment method based on said system specifically includes following steps:
S101, the client 1011 of debugging machine 101 send the instruction reading kernel type information.
S102, described instruction are sent to target machine 102 by the network interface 1011 of debugging machine 101.
S103, the network interface 1021 of target machine 102 receive instruction.
S104, baseboard management controller 1022 control central processing unit 1023 from interior by self-defined bus after resolving instruction The static buffer depositing 1024 reads kernel type information.As it is shown on figure 3, the structure of the most described instruction include but It is not limited to: Head: labeling head;Body Size: message body length;Command: instruction;Sequence: instruction sequence number; Version: protocol version;Check Code: head school code;Body: message body.As shown in Figure 4, substrate pipe in the present embodiment Reason controller 1022 resolves the detailed process of instruction and includes: one, baseboard management controller 1022 is from the network interface 1021 of target machine 102 Read instruction;Two, head mark Head of instruction is found;Three, judging whether to find head mark Head, if not finding, then returning Receipt row step one, otherwise performs step 4;Four, the whole head of instruction is read;Five, check code is read;Six, school is judged whether Testing and pass through, passing through if not verifying, then return and perform step one, otherwise perform step 7;Seven, according to the message body length of instruction Body Size reads message body Body;Eight, corresponding operating is carried out according to instruction Command and message body Body.
S105, baseboard management controller 1022 send described kernel type information.
S106, described kernel type information are sent to debugging machine 101 by the network interface 1021 of target machine 102.
S107, the client 1011 of debugging machine 101 receive kernel type information by network interface 1012, and are shown on boundary On face.
Technical scheme efficiently solves cannot debug Linux by printk during os starting The problem of kernel.
One of ordinary skill in the art will appreciate that all or part of flow process realizing in above-described embodiment method, be permissible Instructing relevant hardware by computer program to complete, described program can be stored in a computer read/write memory medium In, this program is upon execution, it may include such as the flow process of the embodiment of above-mentioned each method.Wherein, described storage medium can be magnetic Dish, CD, read-only store-memory body (Read-Only Memory, ROM) or random store-memory body (Random Access Memory, RAM) etc..
The know-why of the present invention is described above in association with specific embodiment.These describe and are intended merely to explain the present invention's Principle, and limiting the scope of the invention can not be construed to by any way.Based on explanation herein, the technology of this area Personnel need not pay performing creative labour can associate other detailed description of the invention of the present invention, and these modes fall within Within protection scope of the present invention.

Claims (4)

1. a linux kernel debugging system, it is characterised in that include debugging machine and target machine;Described debugging machine include but not It is limited to client and network interface;Described target machine includes but not limited to network interface, baseboard management controller, central processing unit and internal memory; Described debugging machine realizes data between the two with target machine by respective network interface and transmits.
2. one kind based on the linux kernel adjustment method debugging system described in claim 1, it is characterised in that include walking as follows Rapid:
S101, the client of debugging machine send the instruction reading kernel type information;
S102, described instruction are sent to target machine by the network interface of debugging machine;
S103, the network interface of target machine receive instruction;
S104, baseboard management controller control the central processing unit static buffering from internal memory by self-defined bus after resolving instruction District reads kernel type information;
S105, baseboard management controller send described kernel type information;
S106, described kernel type information are sent to debugging machine by the network interface of target machine;
S107, the client of debugging machine receive kernel type information by network interface, and are shown on interface.
Linux kernel adjustment method the most according to claim 2, it is characterised in that the structure of instruction in described step S104 Make and include but not limited to: Head: labeling head;Body Size: message body length;Command: instruction;Sequence: sequence of instructions Number;Version: protocol version;Check Code: head school code;Body: message body.
Linux kernel adjustment method the most according to claim 3, it is characterised in that substrate management in described step S104 Controller resolves the process of instruction and specifically includes: one, baseboard management controller reads instruction from the network interface of target machine;Two, find Head mark Head of instruction;Three, judge whether to find head mark Head, if not finding, then return and perform step one, otherwise Perform step 4;Four, the whole head of instruction is read;Five, check code is read;Six, judge whether that verification is passed through, if not verifying logical Cross, then return and perform step one, otherwise perform step 7;Seven, message body is read according to the message body length Body Size of instruction Body;Eight, corresponding operating is carried out according to instruction Command and message body Body.
CN201610551621.8A 2016-07-13 2016-07-13 A kind of linux kernel debugging system and method Active CN106227653B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610551621.8A CN106227653B (en) 2016-07-13 2016-07-13 A kind of linux kernel debugging system and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610551621.8A CN106227653B (en) 2016-07-13 2016-07-13 A kind of linux kernel debugging system and method

Publications (2)

Publication Number Publication Date
CN106227653A true CN106227653A (en) 2016-12-14
CN106227653B CN106227653B (en) 2018-10-30

Family

ID=57520521

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610551621.8A Active CN106227653B (en) 2016-07-13 2016-07-13 A kind of linux kernel debugging system and method

Country Status (1)

Country Link
CN (1) CN106227653B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955582A (en) * 2019-11-24 2020-04-03 浪潮电子信息产业股份有限公司 Kernel information output method, device and equipment and readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7293165B1 (en) * 2003-04-03 2007-11-06 Advanced Micro Devices, Inc. BMC-hosted boot ROM interface
CN101135991A (en) * 2007-10-10 2008-03-05 中兴通讯股份有限公司 Method for realizing bare nucleus software debugging in multicore processor
CN102521087A (en) * 2011-11-02 2012-06-27 烽火通信科技股份有限公司 System and method for remotely obtaining real-time graded debugging information of kernel module
US9298591B1 (en) * 2001-07-10 2016-03-29 Versata Development Group, Inc. System and method for remotely debugging application programs

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9298591B1 (en) * 2001-07-10 2016-03-29 Versata Development Group, Inc. System and method for remotely debugging application programs
US7293165B1 (en) * 2003-04-03 2007-11-06 Advanced Micro Devices, Inc. BMC-hosted boot ROM interface
CN101135991A (en) * 2007-10-10 2008-03-05 中兴通讯股份有限公司 Method for realizing bare nucleus software debugging in multicore processor
CN102521087A (en) * 2011-11-02 2012-06-27 烽火通信科技股份有限公司 System and method for remotely obtaining real-time graded debugging information of kernel module

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DISCLOSED ANONYMOUSLY: "《www.researchdisclosure.com,Research Disclosure database number 517034》", 10 May 2007 *
张磊等: ""Linux内核调试技术"", 《计算机工程》 *
胡贯荣等: ""基于arm的嵌入式 Linux 内核调试技术"", 《计算机工程与设计》 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110955582A (en) * 2019-11-24 2020-04-03 浪潮电子信息产业股份有限公司 Kernel information output method, device and equipment and readable storage medium

Also Published As

Publication number Publication date
CN106227653B (en) 2018-10-30

Similar Documents

Publication Publication Date Title
US8918673B1 (en) Systems and methods for proactively evaluating failover nodes prior to the occurrence of failover events
US6910160B2 (en) System, method, and computer program product for preserving trace data after partition crash in logically partitioned systems
US6865688B2 (en) Logical partition management apparatus and method for handling system reset interrupts
US9607120B2 (en) Implementing system irritator accelerator FPGA unit (AFU) residing behind a coherent attached processors interface (CAPI) unit
US8782469B2 (en) Request processing system provided with multi-core processor
US9697068B2 (en) Building an intelligent, scalable system dump facility
US20110197011A1 (en) Storage apparatus and interface expansion authentication method therefor
US20090307688A1 (en) Virtual Cluster Proxy to Virtual I/O Server Manager Interface
US20150206272A1 (en) Selectively killing trapped multi-process service clients sharing the same hardware context
US7962782B2 (en) Modifying connection records
US20170031694A1 (en) System and method for remote system configuration managment
US20100235558A1 (en) Multiprocessor System Having Multiple Watchdog Timers and Method of Operation
US10606677B2 (en) Method of retrieving debugging data in UEFI and computer system thereof
US10997099B2 (en) I/O request processing method in virtual machine, device and computer readable medium
US20170277439A1 (en) Techniques for Path Optimization in Storage Networks
CN109597653A (en) Method, BIOS and the BMC of BIOS and BMC command interaction
US20230115629A1 (en) SYSTEM AND METHOD FOR VALIDATING A POWER CYCLE FOR AN EMULATED PCIe BASED STORAGE DEVICE
KR20050058241A (en) Method and apparatus for enumeration of a multi-node computer system
US20200371827A1 (en) Method, Apparatus, Device and Medium for Processing Data
US8346975B2 (en) Serialized access to an I/O adapter through atomic operation
US8139595B2 (en) Packet transfer in a virtual partitioned environment
US10831684B1 (en) Kernal driver extension system and method
CN106227653A (en) A kind of linux kernel debugging system and method
CN113342698A (en) Test environment scheduling method, computing device and storage medium
US7657730B2 (en) Initialization after a power interruption

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant