CN103984568A - PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method - Google Patents

PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method Download PDF

Info

Publication number
CN103984568A
CN103984568A CN201410168397.5A CN201410168397A CN103984568A CN 103984568 A CN103984568 A CN 103984568A CN 201410168397 A CN201410168397 A CN 201410168397A CN 103984568 A CN103984568 A CN 103984568A
Authority
CN
China
Prior art keywords
equipment
pci
driving method
register
driver
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.)
Pending
Application number
CN201410168397.5A
Other languages
Chinese (zh)
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.)
Shandong Chaoyue Numerical Control Electronics Co Ltd
Original Assignee
Shandong Chaoyue Numerical Control Electronics Co 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 Shandong Chaoyue Numerical Control Electronics Co Ltd filed Critical Shandong Chaoyue Numerical Control Electronics Co Ltd
Priority to CN201410168397.5A priority Critical patent/CN103984568A/en
Publication of CN103984568A publication Critical patent/CN103984568A/en
Pending legal-status Critical Current

Links

Abstract

The invention provides a PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method. The specific realization process of the PCI-to-CF driving method comprises the steps of creating a CF driver in a ReWorks operating system; initializing CF device and creating a device file system; after a device driver is established, using I/O (Input/Output) functions to access the CF device; packing the driver in the ReWorks operating system, compiling the kernel of the system and programming the driver on a handheld computer platform; after the system is started, inserting the CF device into a slot, wherein the system automatically recognizes the CF device, the CF device is configured after recognition and the CF device completes storage backup; pulling out the CF device, wherein the system automatically uninstalls the CF device. Compared with the prior art, the PCI-to-CF driving method has the advantages that the CF extension function is realized, the practicability is high, the application scope is wide and the popularization is facilitated.

Description

A kind of PCI turns CF driving method
Technical field
The present invention relates to field of computer technology, specifically a kind of PCI turns CF driving method.
Background technology
The universal cpu of institute's independent research calculates in the Godson series processors Shi Shi Chinese Academy of Sciences, and wherein Godson 1 series processors is towards Embedded Application such as Industry Control, consumer electronics (mobile phone/MP4/ palm PC etc.).Godson 1A processor itself is not supported CF expansion, but many special trade users have the expansion equipment of a lot of CF interfaces as military user etc.CF card can be operated in three kinds of patterns: PC Card Memory pattern, PC Card I/O pattern and True IDE pattern.True IDE pattern using is less, and PC Card Memory pattern can be supported CF interface memory card, but the CF interfacing equipment of military user is mostly PC Card I/O pattern at present, and the CF interface of this pattern can only produce by pci bus.And Godson 1A supports pci bus expansion, therefore we adopt the pci bus of Godson 1A to expand a standard C F interface, have both supported Compact Flash, also support other equipment of CF interface.
ReWorks embedded OS is the embedded real-time operating system that the 32nd, the China Electronics science and technology group technological achievement based on " 95 ", " 15 " is developed voluntarily, is applicable to plurality of target hardware environment (x86, mips).ReWorks operating system adopts object-oriented and Microkernel exploitation, has hard real-time, Scalability and scalability, and VxWorks compatible layer is provided.
Still PCI under domestic embedded OS ReWorks is not turned to the research that CF drives at present, therefore, now provide a kind of based on having realized the driving method that PCI is turned to CF interface under domestic embedded OS ReWorks.
Summary of the invention
Technical assignment of the present invention is in the deficiencies in the prior art, provides a kind of PCI to turn CF driving method.
Technical scheme of the present invention realizes in the following manner, and this one PCI turns CF driving method, and its specific implementation process is:
One, in ReWorks operating system, create CF and drive: initialization CF equipment, creates installable file system;
Two, after apparatus for establishing driver, use I/O function access CF equipment, this I/O function comprises: create (), open (), read (), write () and remove () function;
Three, driver is packed into ReWorks operating system, compiling system kernel, programming is to Godson 1A handheld computer platform;
Four, after startup system, CF equipment is inserted to slot, system is identified CF equipment automatically, after identification, CF equipment is configured, and CF equipment completes storage backup;
Five, CF equipment is extracted to system Self-tipping CF equipment.
In described step 3, drive the process of identification CF equipment to be automatically: ReWorks identifies PCI equipment by the classification of PCI equipment, the classification of PCI equipment comprises PCI class, PCI subclass and PCI agreement, the ReWorks constant PCID_NOTIFY_ALL that gives a definition, this constant represents above-mentioned all PCI classes, PCI subclass and PCI agreement, identifies the plug of all PCI kind equipments by programming.
In described step 3, the layoutprocedure of CF equipment is: first, drive the GPIO that transmission CF signal is set in system, and for it distributes the IO port that addressing is used, under PC card I/O pattern, the IO port of CF equipment is the 16 byte data pieces in its common store space; Secondly, property store space to CF equipment is configured, this configuration refers to be verified the value of CF device attribute option register, configuration status register, pin replacement register, socket copy register, if these values are not mated with default value, its value will be used as default.
In described step 3, the storage backup process of CF equipment is:
System is issued ATA instruction to CF equipment, and this ATA command request CF equipment could be processed the data stream in CF buffer zone in busy condition not and while having request of data in the time receiving order;
Driver obtains the piece number of CF equipment according to the I/O request of system, utilize this piece number to calculate the LBA address of CF equipment;
Then get the low 28 of block, the low bit register of the cylinder of corresponding CF equipment, the high bit register of cylinder, sector register, equipment/head register successively, these parameter values and ATA instruction are write in corresponding registers by 8 modes, complete storing process one time.
The beneficial effect that the present invention compared with prior art produced is:
A kind of PCI of the present invention turns CF driving method to be realized based on domestic operating system, has realized CF expanded function, practical, applied widely, is easy to promote.
Brief description of the drawings
Accompanying drawing 1 is hardware configuration schematic diagram of the present invention.
Embodiment
Below in conjunction with accompanying drawing, a kind of PCI provided by the present invention being turned to CF driving method is described in detail below.
As shown in Figure 1, the invention provides a kind of PCI and turn CF driving method, first configurator hardware device, hardware entirety adopts structure as shown in Figure 1, hardware in this accompanying drawing is basic identical with prior art hardware, but its CPU adopts domestic Godson CPU, it is the sharp China in accompanying drawing at ReWorks(that software systems are used domestic) operating system.
After hardware setting completes, its concrete PCI turns CF and drives implementation procedure to be:
One,, in ReWorks operating system, create CF and drive: initialization CF equipment, create installable file system, the key source code of this establishment is:
If(pciDrv(PCI_INT_VEC,IDE_INT_VEC,type)==ERROR)
printf(“Could?not?initialize.\n”);
dosFsInit(NUM_DOSFS_FILES);
if(usrIdeConfig(drive,fileName)==ERROR)
……
Two, after apparatus for establishing driver, use I/O function access CF equipment, this I/O function comprises: create (), open (), read (), write () and remove () function;
Three, driver is packed into ReWorks operating system, compiling system kernel, programming is to Godson 1A handheld computer platform;
Four, after startup system, CF equipment is inserted to slot, system is identified CF equipment automatically, after identification, CF equipment is configured, and CF equipment completes storage backup;
Five, CF card is extracted to system Self-tipping CF equipment.
In described step 3, drive the process of identification CF equipment to be automatically: ReWorks identifies PCI equipment by the classification of PCI equipment, the classification of PCI equipment is from PCI class, PCI subclass and the definition of PCI agreement three aspects:, but in reality because device class is many, not all equipment can be easy to find its device class, the method of a more convenient identification PCI equipment is provided under ReWorks, the ReWorks constant PCID_NOTIFY_ALL that gives a definition, this constant can represent all PCI classes, PCI subclass and PCI agreement, can identify the plug of all PCI kind equipments.Survey (probe) function code as follows:
static?int?pci_bus_probe(struct?device?*dev)
{
struct?pci_driver?*drv?=?to_pci_driver(dev->driver);
struct?pci_card?*card?=?dev_to_pci_card(dev);
return?drv->probe(card);
}
In described step 3, the layoutprocedure of CF equipment is: before CF card is carried out to storage operation, driver will carry out necessary configuration to it.First, drive the GPIO that transmission CF signal is set in system, and distribute for it IO port that addressing is used.Under PC Card I/O pattern, the IO port of CF card is the 16 byte data pieces in its common store space.Secondly, the property store space of CF card is configured.For guaranteeing correct use CF card, driving need to be verified the value of its attributes section register, configuration status register, pin replacement register, socket copy register, if these values are not mated with default value, its value will be used as default.
In described step 3, the storage backup process of CF equipment is:
Realize the storage backup function of CF, require CF card correctly to receive and the I/O request of responding system to it, system and then issue ATA instruction to CF.ATA instruction set is divided into 3 classes, and every class order all requires CF to be stuck in while receiving order could process the data stream in CF/ buffer zone in the time not being in a hurry (BSY=0) state and having request of data (DRQ=1).Driver obtains the piece number of CF card according to the I/O request of system, utilize this piece number to calculate the LBA address of CF card.Get the low 28 of block, the low bit register of the cylinder of corresponding CF card, the high bit register of cylinder, sector register, equipment/head register successively, writes these parameter values and ATA instruction in corresponding registers by 8 modes, completes storing process one time.
In addition, a large characteristic of the embedded memory device such as CF card can be accomplished plug and play exactly.In ReWorks system, system layer and application layer all will be processed hot plug event.In system layer, to survey on the one hand the hot plug event of CF card, distribute or free system resources, and drive CF equipment; On the other hand, be by the hot plug event of storage card notice application layer promptly and accurately.Application layer is made corresponding processing according to hot plug event.
Except the technical characterictic described in instructions, be the known technology of those skilled in the art.

Claims (4)

1. PCI turns a CF driving method, it is characterized in that: its specific implementation process is:
One, in ReWorks operating system, create CF and drive: initialization CF equipment, creates installable file system;
Two, after apparatus for establishing driver, use I/O function access CF equipment, this I/O function comprises: create (), open (), read (), write () and remove () function;
Three, driver is packed into ReWorks operating system, compiling system kernel, programming is to Godson 1A handheld computer platform;
Four, after startup system, CF equipment is inserted to slot, system is identified CF equipment automatically, after identification, CF equipment is configured, and CF equipment completes storage backup;
Five, CF equipment is extracted to system Self-tipping CF equipment.
2. a kind of PCI according to claim 1 turns CF driving method, it is characterized in that: in described step 3, drive the process of identification CF equipment to be automatically: ReWorks identifies PCI equipment by the classification of PCI equipment, the classification of PCI equipment comprises PCI class, PCI subclass and PCI agreement, the ReWorks constant PCID_NOTIFY_ALL that gives a definition, this constant represents above-mentioned all PCI classes, PCI subclass and PCI agreement, identifies the plug of all PCI kind equipments by programming.
3. a kind of PCI according to claim 1 turns CF driving method, it is characterized in that: in described step 3, the layoutprocedure of CF equipment is: first, drive the GPIO that transmission CF signal is set in system, and distribute for it IO port that addressing is used, under PC card I/O pattern, the IO port of CF equipment is the 16 byte data pieces in its common store space; Secondly, property store space to CF equipment is configured, this configuration refers to be verified the value of CF device attribute option register, configuration status register, pin replacement register, socket copy register, if these values are not mated with default value, its value will be used as default.
4. a kind of PCI according to claim 1 turns CF driving method, it is characterized in that: in described step 3, the storage backup process of CF equipment is:
System is issued ATA instruction to CF equipment, and this ATA command request CF equipment could be processed the data stream in CF buffer zone in busy condition not and while having request of data in the time receiving order;
Driver obtains the piece number of CF equipment according to the I/O request of system, utilize this piece number to calculate the LBA address of CF equipment;
Then get the low 28 of block, the low bit register of the cylinder of corresponding CF equipment, the high bit register of cylinder, sector register, equipment/head register successively, these parameter values and ATA instruction are write in corresponding registers by 8 modes, complete storing process one time.
CN201410168397.5A 2014-04-25 2014-04-25 PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method Pending CN103984568A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410168397.5A CN103984568A (en) 2014-04-25 2014-04-25 PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410168397.5A CN103984568A (en) 2014-04-25 2014-04-25 PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method

Publications (1)

Publication Number Publication Date
CN103984568A true CN103984568A (en) 2014-08-13

Family

ID=51276561

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410168397.5A Pending CN103984568A (en) 2014-04-25 2014-04-25 PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method

Country Status (1)

Country Link
CN (1) CN103984568A (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540530A (en) * 2003-10-31 2004-10-27 港湾网络有限公司 Method for implementing hot plug for CF card
CN101840306A (en) * 2009-03-18 2010-09-22 研祥智能科技股份有限公司 Method and system for driving SATA (Serial Advanced Technology Attachment) device in VxWorks operating system
CN103279441A (en) * 2013-05-21 2013-09-04 山东超越数控电子有限公司 USB-to-CF/SD driving method based on domestic embedded type operation system
CN103744713A (en) * 2014-02-11 2014-04-23 哈尔滨工业大学 Autonomous configuration method for FPGA (field programmable gate array)-based embedded dual-core system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1540530A (en) * 2003-10-31 2004-10-27 港湾网络有限公司 Method for implementing hot plug for CF card
CN101840306A (en) * 2009-03-18 2010-09-22 研祥智能科技股份有限公司 Method and system for driving SATA (Serial Advanced Technology Attachment) device in VxWorks operating system
CN103279441A (en) * 2013-05-21 2013-09-04 山东超越数控电子有限公司 USB-to-CF/SD driving method based on domestic embedded type operation system
CN103744713A (en) * 2014-02-11 2014-04-23 哈尔滨工业大学 Autonomous configuration method for FPGA (field programmable gate array)-based embedded dual-core system

Similar Documents

Publication Publication Date Title
JP6253614B2 (en) Storage device virtualization
KR101802806B1 (en) Secure enclaves for use by kernel mode applications
US8370835B2 (en) Method for dynamically generating a configuration for a virtual machine with a virtual hard disk in an external storage device
CN103412769A (en) External card parameter configuration method, equipment and system
CN109240754B (en) Logic device, method and system for configuring BIOS starting item
TWI685743B (en) Apparatus and method and computer program product for controlling data access
US10002002B2 (en) Communication of device presence between boot routine and operating system
WO2016188037A1 (en) Version burning method, system and terminal, and computer storage medium
US9672047B1 (en) Systems and methods for accessing a bootable partition on a serial peripheral interface device
CN103279441B (en) A kind of USB based on domestic embedded OS turns CF/SD driving methods
CN112988060A (en) Key value storage device and method for operating key value storage device
US9553761B2 (en) Dynamic server to server configuration and initialization
CN103942088A (en) Method for acquiring using conditions of USB storage device of virtual machine
KR102128472B1 (en) Storage device for performing in-storage computing operations, method thereof, and system including same
US7644222B2 (en) Low latency event communication system and method
US9792042B2 (en) Systems and methods for set membership matching
US8499142B1 (en) UEFI boot loader for loading non-UEFI compliant operating systems
US10592438B2 (en) Firmware configuration through emulated commands
CN106951268A (en) A kind of Shen prestige platform supports the implementation method of NVMe hard disk startups
CN103984568A (en) PCI (Peripheral Component Interconnection)-to-CF (Compact Flash) driving method
CN110955442A (en) Bootloader suitable for PCI-E password card
CN102141915A (en) Equipment real-time control method based on RTLinux
TW202333047A (en) Device, system and method for acceleration
CN116434040A (en) RISC-V (reduced instruction set computer-virtual machine) architecture-oriented real-time target detection method and system
US20180329629A1 (en) Data wiping of solid-state drives

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20140813

WD01 Invention patent application deemed withdrawn after publication