Development of DiskOnChip Device Driver in Embedded Linux

Source: Internet
Author: User
Driver development for DiskOnChip in Embedded Linux-general Linux technology-Linux programming and kernel information. For details, see the following. 1 Introduction

With the rapid development of the information age combining Computer and Communication technologies and the wide application of the Internet, the integration of 3C (Computer, Communication, and Consumer) has become a trend, the result is to transfer the computer industry center from computing products to embedded information products.

However, due to the application requirements and cost factors of embedded systems, the embedded system is very simple and efficient in terms of system resources, including hardware resources and software resources. Therefore, storage devices in embedded systems generally do not use large-capacity high-power devices such as hard disks, but use storage media such as CompactFlash and EPROM. Therefore, this article introduces the next-generation flash FlashDiskOnChip 2000 developed by M-systems to support and drive file systems and Block devices on Embedded Linux systems.

2. Hardware System Structure

Flash, the internal storage medium of an electronic disk, is the fastest-growing storage chip in recent years. It features E2PROM erasability and cheap EPROM, it is a high-performance, low-power, electrically erasable memory device. Based on the above features, electronic disks have been widely used in information storage, set-top boxes, network computing, embedded computers, and other fields.

The DiskOnChip 2000 series released by M-system is a new generation of Flash disks ). It is a standard 32-foot DIP package and is fully compatible with the standard E2PROM. General flash memory only contains the memory part, and the controller must be added. To manage flash disks, The DiskOnChip contains the MSystem flash File System (TrueFFS) software. This makes it easy to use and does not require any special and complex algorithms. The read/write operations are identical to those on the hard disk. Therefore, they can be used as independent hard disks and are compatible with other disks. You can directly boot the computer system without other system disks. The DiskOnChip is ideal for 3.3 V and 5 V power supplies with low power consumption and small portable devices with limited space. The DOC2000 structure mainly consists of SystemIterface, BootBlock, Flash control, and Flash storage media.

The System Interface Unit provides an interface similar to SRAM for DOC2000 to establish a connection with the operating system through the CPU's local bus, ISA bus, and SRAM bus. DOC provides the chip selection signal (CE #), read/write signal (WE #), enable signal (OE #), and 13-bit address line (A [0: 12]). and 8-bit wide Data Bus (D [0: 7]). The system interface generates corresponding control signals under the control of the main bus signal (read, write, address and chip selection) and sends them to the flash disk. The internal ROM provides an IPL code, this code loads the Flash file system software into PC memory during computer startup. The extended BIOS of the PC has a storage area of more than 8 kB. Its address is 0C000H ~ 0 EFFFH. After the computer starts the self-check, DiskOnChip is part of the BIOS standard operation of the PC. the BIOS searches for the ROM extended code and finds it. Then, the BIOS executes the initialization code in the flash disk, which loads the Flash file system software into the memory. The flash disk will also be installed as a system disk, and the transmitter will be controlled back to the BIOS code. When the operating system needs to determine the disk suitable for the system, the flash disk software imitates a hard disk to respond.

3. TrueFFS and Linux File Systems

TrueFFS is a patented technology developed by M-system for electronic disk equipment. TrueFFS is an integrated fast FLASH file system in Tornadoll development environment. It simulates the disk of the DOC block device through TrueFFS, this makes it easy for the embedded Linux system to read, write, partition, and format electronic disks. It is called through I/O Control of the operating system. Linux can access the TureFFS external interface through VFS.

The best part of the Linux File System is the support for multiple file systems (the upper-layer structure here refers to the VFS System and the specific file system, that is, the part other than the buffer management system ). To achieve this feature, an abstract layer must be defined to describe various file systems in a unified manner. In Linux, VFS is used to implement this abstraction layer. At the same time, each specific file system must have a means of interacting with VFS.

The top module of Linux File System Management is the file system. When the system starts, you must first mount the "root" file system, and then create a file system one by one based on the specified in/etc/fstab. In addition, you can install or uninstall the file system at any time through mount and umount operations. In Linux, The GetDriveHandle () function of the operating system is called to obtain the drive handle. Its return value is a TrueFFS driver descriptor that can be called by I/O control functions. Then, call the IOCongtrol () function of the file system in the operating system. With the support of VFS, TrueFFS has the features of a general file system. When a process releases a file-oriented system call, the core calls the corresponding functions in VFS, which process operations unrelated to the physical structure, in addition, the function is redirected to the corresponding function calls in the real file system, and these function calls are used to process the operations related to the physical structure.
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.