CN106227653B - 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
CN106227653B
CN106227653B CN201610551621.8A CN201610551621A CN106227653B CN 106227653 B CN106227653 B CN 106227653B CN 201610551621 A CN201610551621 A CN 201610551621A CN 106227653 B CN106227653 B CN 106227653B
Authority
CN
China
Prior art keywords
instruction
debugging
machine
network interface
kernel
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.)
Active
Application number
CN201610551621.8A
Other languages
Chinese (zh)
Other versions
CN106227653A (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 present invention discloses a kind of linux kernel debugging system and method, and described method includes following steps:The client of debugging machine sends the instruction for reading kernel type information;Described instruction is transmitted to target machine by debugging the network interface of machine;The network interface of target machine receives instruction;Central processing unit is controlled by self-defined bus after baseboard management controller analysis instruction and reads kernel type information from the static buffer of memory;Baseboard management controller sends the kernel type information;The 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 it will be shown on interface.The present invention solves the problems, such as that linux kernel can not be debugged by printk 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 more particularly to a kind of linux kernel debugging systems and method.
Background technology
Linux inherits Unix using network as the design philosophy of core, is the multiple-user network operation that a performance is stablized System.Linux kernel is a Monolithic Kernel system.Kernel refers to that one provides hardware abstraction layer, disk and file system The system software for the functions such as control, multitask of uniting.As embedded device is more and more common, many functions are all in Linux It is developed inside core, i.e., the code that function is realized is integrated in inside linux kernel, is not used as application program in User space reality It is existing, it can not thus be convenient to use the debugging acids such as GDB and remove debugging positioning application program running state.Currently, debugging Linux Kernel main method has printk ,/proc and kgdb etc., the printk of most common of which.Printk is run in kernel To console output display function, linux kernel first kernel spacing distribute a static buffer, as display use Space, then call sprintf, format and show character string, finally call tty_write to terminal into the aobvious of row information Show.But it is different operating system and has different effect, such as write a hello word kernel module, use this Content can be not necessarily shown in terminal by function, but centainly in kernel buffers, " dmesg " order can be used to check Effect.However linux kernel, if encountering mistake and coming to a halt or collapse, will be unable to pass through in the process of startup " dmesg " orders the type information for checking kernel printk.Kernel can not be debugged by printk in this case.
Invention content
It is an object of the invention to by a kind of linux kernel debugging system and method, to solve background above technology department Divide the problem of mentioning.
For this purpose, the present invention uses following technical scheme:
A kind of linux kernel debugging system comprising debugging machine and target machine;The debugging machine includes but not limited to client End and network interface;The target machine includes but not limited to network interface, baseboard management controller (BMC), central processing unit (CPU) and interior It deposits;The debugging machine realizes data transmission between the two with target machine by respective network interface.
The linux kernel adjustment method based on above system that the invention also discloses a kind of, includes the following steps:
S101, the client for debugging machine send the instruction for reading kernel type information;
S102, described instruction are transmitted to target machine by debugging the network interface of machine;
The network interface reception instruction of S103, target machine;
Static state of the central processing unit from memory is controlled by self-defined bus after S104, baseboard management controller analysis instruction Buffering area reads kernel type information;
S105, baseboard management controller send the kernel type information;
S106, the kernel type information are sent to debugging machine by the network interface of target machine;
S107, the client for debugging machine receive kernel type information by network interface, and it will be shown on interface.
Particularly, the construction instructed in the step S104 includes but not limited to:Head:Labeling head;Body Size:Disappear Cease body length;Command:Instruction;Sequence:Instruct serial number;Version:Protocol version;Check Code:Head school code; Body:Message body.
Particularly, the process of baseboard management controller analysis instruction specifically includes in the step S104:One, substrate management Controller reads from the network interface of target machine and instructs;Two, the head mark Head of instruction is found;Three, judge whether to find head mark Note Head returns to step one, otherwise executes step 4 if not finding;Four, the entire head of instruction is read;Five, it reads Check code;Six, judge whether that verification passes through, pass through if not verifying, return to step one, otherwise execute step 7;Seven, root Message body Body is read according to the message body length Body Size of instruction;Eight, it is carried out according to instruction Command and message body Body Corresponding operating.
Linux kernel debugging system and method proposed by the present invention are efficiently solved can not during os starting The problem of linux kernel being debugged by printk.
Description of the drawings
Fig. 1 is linux kernel debugging system structural schematic diagram provided in an embodiment of the present invention;
Fig. 2 is linux kernel adjustment method flow provided in an embodiment of the present invention;
Fig. 3 is the organigram of instruction provided in an embodiment of the present invention;
Fig. 4 is the particular flow sheet of baseboard management controller analysis instruction provided in an embodiment of the present invention.
Specific implementation mode
To facilitate the understanding of the present invention, below with reference to relevant drawings to invention is more fully described.In attached 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 this paper institutes The embodiment of description.On the contrary, purpose of providing these embodiments is make to understand the disclosure it is more thorough Comprehensively.It should be noted that unless otherwise defined, all of technologies and scientific terms used here by the article and belong to the present invention's The normally understood meaning of those skilled in the art is identical.Used term is in the description of the invention herein In order to describe the purpose of specific embodiment, it is not intended that in the limitation present invention.Term " and or " used herein includes one Any and all combinations of a or multiple relevant Listed Items.
It please refers to shown in Fig. 1, Fig. 1 is linux kernel debugging system structural schematic diagram provided in an embodiment of the present invention.
Linux kernel debugging system specifically includes debugging machine 101 and target machine 102 in the present embodiment;The debugging machine 101 Including but not limited to client 1011 and network interface 1012;The target machine 102 includes but not limited to network interface 1021, substrate management control Device 1022, central processing unit 1023 and memory 1024 processed;The debugging machine 101 is realized with target machine 102 by respective network interface Data transmission between the two.Wherein, the baseboard management controller (Baseboard Management Controller, BMC) Support the IPMI specifications of professional standard;The specification describes the management function being built on mainboard;These functions include:This Ground and remote diagnosis, console support, configuration management, hardware management and troubleshooting.
As shown in Fig. 2, Fig. 2 is linux kernel adjustment method flow provided in an embodiment of the present invention.
The linux kernel adjustment method based on above system specifically comprises the following steps in the present embodiment:
S101, the client 1011 for debugging machine 101 send the instruction for reading kernel type information.
S102, described instruction are transmitted to target machine 102 by the network interface 1011 of debugging machine 101.
The reception instruction of network interface 1021 of S103, target machine 102.
Central processing unit 1023 is controlled from interior by self-defined bus after S104,1022 analysis instruction of baseboard management controller The static buffer for depositing 1024 reads kernel type information.As shown in figure 3, in the present embodiment the construction of described instruction include but It is not limited to:Head:Labeling head;Body Size:Message body length;Command:Instruction;Sequence:Instruct serial number; Version:Protocol version;Check Code:Head school code;Body:Message body.As shown in figure 4, substrate pipe in the present embodiment Reason 1022 analysis instruction of controller detailed process include:One, network interface 1021 of the baseboard management controller 1022 from target machine 102 Read instruction;Two, the head mark Head of instruction is found;Three, judge whether to find head mark Head, if not finding, return Receipt row step 1, otherwise executes step 4;Four, the entire head of instruction is read;Five, check code is read;Six, judge whether school It tests and passes through, pass through if not verifying, return to step one, otherwise execute step 7;Seven, according to the message body length of instruction Body Size read message body Body;Eight, corresponding operating is carried out according to instruction Command and message body Body.
S105, baseboard management controller 1022 send the kernel type information.
S106, the kernel type information are sent to debugging machine 101 by the network interface 1021 of target machine 102.
S107, the client 1011 for debugging machine 101 receive kernel type information by network interface 1012, and it will be shown in boundaries On face.
Technical scheme of the present invention is efficiently solved can not debug Linux during os starting by printk The problem of kernel.
One of ordinary skill in the art will appreciate that realizing all or part of flow in above-described embodiment method, being can be with Relevant hardware is instructed to complete by computer program, the program can be stored in a computer read/write memory medium In, the program is when being executed, it may include such as the flow of the embodiment of above-mentioned each method.Wherein, the storage medium can be magnetic Dish, CD, read-only memory (Read-Only Memory, ROM) or random access memory (Random Access Memory, RAM) etc..
The technical principle of the present invention is described above in association with specific embodiment.These descriptions are intended merely to explain the present invention's Principle, and it cannot be construed to limiting the scope of the invention in any way.Based on the explanation herein, the technology of this field Personnel would not require any inventive effort the other specific implementation modes that can associate the present invention, these modes are fallen within Within protection scope of the present invention.

Claims (3)

1. a kind of linux kernel adjustment method, this method is realized based on linux kernel debugging system, the linux kernel debugging System includes debugging machine and target machine;The debugging machine includes but not limited to client and network interface;The target machine includes but not It is limited to network interface, baseboard management controller, central processing unit and memory;The debugging machine is realized with target machine by respective network interface Data transmission between the two;It is characterised in that it includes following steps:
S101, the client for debugging machine send the instruction for reading kernel type information;
S102, described instruction are transmitted to target machine by debugging the network interface of machine;
The network interface reception instruction of S103, target machine;
Static buffering of the central processing unit from memory is controlled by self-defined bus after S104, baseboard management controller analysis instruction Read kernel type information in area;
S105, baseboard management controller send the kernel type information;
S106, the kernel type information are sent to debugging machine by the network interface of target machine;
S107, the client for debugging machine receive kernel type information by network interface, and it will be shown on interface.
2. linux kernel adjustment method according to claim 1, which is characterized in that the structure instructed in the step S104 It makes including 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.
3. linux kernel adjustment method according to claim 2, which is characterized in that substrate management in the step S104 The process of controller analysis instruction specifically includes:One, baseboard management controller reads from the network interface of target machine and instructs;Two, it finds The head mark Head of instruction;Three, judge whether to find head mark Head, if not finding, return to step one, otherwise Execute step 4;Four, the entire head of instruction is read;Five, check code is read;Six, judge whether that verification passes through, if not verifying logical It crosses, then returns to step one, otherwise execute 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 CN106227653A (en) 2016-12-14
CN106227653B true 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)

Families Citing this family (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 (2)

* Cited by examiner, † Cited by third party
Title
"Linux内核调试技术";张磊等;《计算机工程》;20030630;第29卷(第10期);第81-83页 *
"基于arm的嵌入式 Linux 内核调试技术";胡贯荣等;《计算机工程与设计》;20070531;第28卷(第10期);第2392-2394页,第2431页 *

Also Published As

Publication number Publication date
CN106227653A (en) 2016-12-14

Similar Documents

Publication Publication Date Title
US8332542B2 (en) Communication with input/output system devices
US20070005828A1 (en) Interrupts support for the KCS manageability interface
US10067692B2 (en) Method and apparatus for backing up and restoring cross-virtual machine application
US9912535B2 (en) System and method of performing high availability configuration and validation of virtual desktop infrastructure (VDI)
US20090307688A1 (en) Virtual Cluster Proxy to Virtual I/O Server Manager Interface
US11614986B2 (en) Non-volatile memory switch with host isolation
US20170031694A1 (en) System and method for remote system configuration managment
US6728791B1 (en) RAID 1 read mirroring method for host adapters
EP2942712A1 (en) Server control method and server control device
US10346321B2 (en) Method to trigger NVDIMM save from remote management interface
US10997099B2 (en) I/O request processing method in virtual machine, device and computer readable medium
US10606677B2 (en) Method of retrieving debugging data in UEFI and computer system thereof
CN101154202B (en) Managing system management interrupts in a multiprocessor computer system
US10063425B1 (en) Event-based in-band host registration
US9870162B2 (en) Method to virtualize PCIe controllers to support boot/hibernation/crash-dump from a spanned virtual disk
KR20050058241A (en) Method and apparatus for enumeration of a multi-node computer system
CN106227653B (en) A kind of linux kernel debugging system and method
US7917659B2 (en) Variable length command pull with contiguous sequential layout
CN106610878B (en) Fault debugging method of double-controller system
US20080010445A1 (en) Initialization After a Power Interruption
US6934771B1 (en) Hardware I/O control block structure for mirrored and non-mirrored data transfers
US7568121B2 (en) Recovery from failure in data storage systems
US20180060170A1 (en) Methods and systems for controlling redundant array of inexpensive disks (raid) operations
TWI748241B (en) Debug message automatically providing method of bios
CN116302007B (en) Disk array firmware upgrading method, device, equipment, medium and disk array card

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