Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Method and device for judging hardware platform based on Linux kernel

A hardware platform and kernel technology, applied in the kernel field, can solve problems such as difficulty in judging hardware platforms

Pending Publication Date: 2017-01-04
OPZOON TECH
View PDF0 Cites 0 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] There are many ways to judge the hardware platform, which can be distinguished by reading bus information or specific hardware features. Generally, the platform is distinguished and judged in user mode, but some programming for the Linux kernel needs to judge the hardware platform type when the kernel is just started. To do different operations, such as setting grub parameters, generally modify the / boot / grub / grub.conf file, but this file is set for all platforms, some special platforms may need to add or delete some special parameters, that is It needs to be set separately in the kernel, and the parameter analysis of grub is generally carried out through the early_param() function, which will be called by parse_early_param() when the kernel calls setup_arch(), and setup_arch() is in the kernel initialization function start_kernel() The calling position of is very high, and it is more difficult to judge the hardware platform at this time

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Method and device for judging hardware platform based on Linux kernel
  • Method and device for judging hardware platform based on Linux kernel

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0017] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly described below in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are the Some, but not all, embodiments are invented. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

[0018] see figure 1 , the present embodiment discloses a method for judging a hardware platform based on the Linux kernel, comprising:

[0019] S1, obtain the CPU type at the stage of detecting the central processing unit (CPU) in the early stage of Linux kernel initialization;

[0020] In a specific application, the result of calling early_cpu_init.cpu_detect() can b...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention discloses a method and device for judging a hardware platform based on Linux kernel. Corresponding hardware platforms are judged according to detected CPU (central processing unit) type in CPU detection phase of the early stage of Linux kernel initiation, and the problem that kernel programming requires to distinguish different hardware platforms to making different operations. The method comprises: S1, acquiring CPU type in the CPU detection phase of the early stage of Linux kernel initiation; S2, adding a hardware platform type judging code into the Linux kernel, assigning values to a global variable indicative of main platform type and a global variable indicative of sub-platform type, with the global variables pre-claimed in kernel source code; S3, determining hardware platform type according to the global variables during subsequent startup or running of the Linux kernel.

Description

technical field [0001] The invention relates to the field of kernel technology, in particular to a method and device for judging a hardware platform based on the Linux kernel. Background technique [0002] Network devices (firewalls, switches, servers, etc.) are divided into high-end and low-end products. There may be many types of hardware platforms from the same company, and different hardware platforms may come from different hardware suppliers, and the product codes used are only one set. Compile product image files that can run on different hardware platforms, that is to say, different hardware platforms need to be distinguished in the product code to realize automatic detection and loading of different platforms. [0003] There are many ways to judge the hardware platform, which can be distinguished by reading bus information or specific hardware characteristics. Generally, the platform is distinguished in user mode, but some programming for the Linux kernel needs to j...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F9/44
CPCG06F8/22
Inventor 高福亮
Owner OPZOON TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products