Embeddedsystem(8).PDF

Similar documents
untitled

untitled

K&R2 Reference Manual 번역본

Chapter #01 Subject

슬라이드 1

교육지원 IT시스템 선진화

¼ÒÇÁÆ®-12È£-ÃÖÁ¾¿Ï¼º

프로그램을 학교 등지에서 조금이라도 배운 사람들을 위한 프로그래밍 노트 입니다. 저 역시 그 사람들 중 하나 입니다. 중고등학교 시절 학교 도서관, 새로 생긴 시립 도서관 등을 다니며 책을 보 고 정리하며 어느정도 독학으르 공부하긴 했지만, 자주 안하다 보면 금방 잊어

10.

chap7.key

Chap 6 모듈프로그래밍및 디바이스드라이버구현

Microsoft Word doc

<4D F736F F F696E74202D205BBAB0C3B75D20B8AEB4AABDBA20B5F0B9D9C0CCBDBA20B5E5B6F3C0CCB9F620B8F0B5A82E >

KEY 디바이스 드라이버


Chap06(Interprocess Communication).PDF

13주-14주proc.PDF

(Microsoft PowerPoint - Device Driver [\310\243\310\257 \270\360\265\345])

1217 WebTrafMon II

10주차.key

Microsoft Word - MPC850 SPI Driver.doc

(Microsoft PowerPoint - Device Driver [\310\243\310\257 \270\360\265\345])

슬라이드 1

chap10.PDF


6주차.key

PowerPoint 프레젠테이션

목 차

리뉴얼 xtremI 최종 softcopy

UI TASK & KEY EVENT

Adding a New Dev file

[8051] 강의자료.PDF

06Àå

UI TASK & KEY EVENT

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

C++-¿Ïº®Çؼ³10Àå

PowerPoint 프레젠테이션

Microsoft PowerPoint - lab14.pptx

(Asynchronous Mode) ( 1, 5~8, 1~2) & (Parity) 1 ; * S erial Port (BIOS INT 14H) - 1 -

04디바이스드라이버

歯MW-1000AP_Manual_Kor_HJS.PDF

Microsoft PowerPoint - IOControl [호환 모드]

교육지원 IT시스템 선진화

°¡°Ç6¿ù³»ÁöÃÖÁ¾

PowerPoint 프레젠테이션

PowerPoint 프레젠테이션

ECE30076 Embedded System Programming - LED Device Driver

망고100 보드로 놀아보자 -13

untitled

PowerPoint 프레젠테이션

6.24-9년 6월

untitled

5.스택(강의자료).key

Sharing Memory Between Drivers and Applications

untitled

untitled

Chapter 4. LISTS

03장.스택.key

PowerPoint Presentation

Microsoft Word doc


À©µµ³×Æ®¿÷ÇÁ·Î±×·¡¹Ö4Àå_ÃÖÁ¾

untitled

Microsoft PowerPoint - polling.pptx

Mango-AM335x LCD Type 커널 Module Parameter에서 변경하기

歯9장.PDF

Microsoft PowerPoint - IP11.pptx

<4D F736F F F696E74202D20C1A63132B0AD20B5BFC0FB20B8DEB8F0B8AEC7D2B4E7>

Microsoft PowerPoint - ch09 - 연결형리스트, Stack, Queue와 응용 pm0100

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CBED0C3E0C7C1B7CEB1D7B7A55C D616E2E637070>

Microsoft Word - KPMC-400,401 SW 사용 설명서

NoSQL

<C0CCBCBCBFB52DC1A4B4EBBFF82DBCAEBBE7B3EDB9AE2D D382E687770>

#SPS/B-BH6000š

MPLAB C18 C

chap 5: Trees

고급 IPC 설비

Sena Technologies, Inc. HelloDevice Super 1.1.0

PowerPoint 프레젠테이션

11장 포인터

<443A5C4C C4B48555C B3E25C32C7D0B1E25CBCB3B0E8C7C1B7CEC1A7C6AE425CC0E7B0EDB0FCB8AE5C53746F636B5F4D616E D656E74732E637070>

final_thesis

PowerPoint 프레젠테이션

Microsoft PowerPoint - lec2.ppt

ARMBOOT 1

리눅스커널-06

본 강의에 들어가기 전

Line (A) å j a k= i k #define max(a, b) (((a) >= (b))? (a) : (b)) long MaxSubseqSum0(int A[], unsigned Left, unsigned Right) { int Center, i; long Max

Microsoft PowerPoint - lab15.pptx

Microsoft PowerPoint - Flash Memory Based Bottom Up Analysis for Smart Phone System _Final [호환 모드]

Microsoft PowerPoint - 3ÀÏ°_º¯¼ö¿Í »ó¼ö.ppt

Connection 8 22 UniSQLConnection / / 9 3 UniSQL OID SET

(72) 발명자 이동희 서울 동작구 여의대방로44길 10, 101동 802호 (대 방동, 대림아파트) 노삼혁 서울 중구 정동길 21-31, B동 404호 (정동, 정동상 림원) 이 발명을 지원한 국가연구개발사업 과제고유번호 부처명 교육과학기술부

The Self-Managing Database : Automatic Health Monitoring and Alerting

OCW_C언어 기초

이번장에서학습할내용 동적메모리란? malloc() 와 calloc() 연결리스트 파일을이용하면보다많은데이터를유용하고지속적으로사용및관리할수있습니다. 2

SRC PLUS 제어기 MANUAL

Transcription:

insmod init_module() register_blkdev() blk_init_queue() blk_dev[] request() default queue blkdevs[] block_device_ops rmmod cleanup_module() unregister_blkdev() blk_cleanup_queue()

static struct { const char *name; struct block_device_operations *bdops; } blkdevs[max_blkdev]; /*MAX_BLKDEV = 255

int register_blkdev(unsigned int major, const char *name, struct block_device_operations *bdops); { if (major == 0){ for (major = MAX_BLKDEV-1; major > 0; major--) { if (blkdevs[major].bdops == NULL) { blkdevs[major].name = name; blkdevs[major].bdops = bdops; return major;} }return EBUSY; } if (major >= MAX_BLKDEV) return EINVAL; if (blkdevs[major].bdops && blkdevs[major].bdops!= bdops) return EBUSY; blkdevs[major].name = name; blkdevs[major].bdops = bdops; return 0; }

int unregister_blkdev(unsigned int major, const char *name); { } if (major >= MAX_BLKDEV) return EINVAL; if (!blkdevs[major].bdops) return EINVAL; if ( strcmp(blkdevs[major].name, name)) return EINVAL; blkdevs[major].name = NULL; blkdevs[major].bdops = NULL; return 0;

struct block_device_operations = { int (*open) (struct inode*, struct file*);/*open int (*release) (struct inode*, struct file*, unsigned, unsigned long);/*close int (*ioctl) (struct inode*, struct file*, unsigned, unsigned long);/*i/o control int (*check_media_change) (kdev_t);/* int (*revalidate) (kdev_t); /* };

struct file_operations def_blk_fops= { open : blkdev_open, /* release : blkdev_close, /* llseek : block_llseek, /* read : block_read, /* write : block_write, /* fsync : block_fsync, /* ioctl : blkdev_ioctl, /* };

User User Application Application Block Block Device Device File File (/dev/xxx) (/dev/xxx) VFS VFS block_read() block_read() block_write() block_write() bread()/breada() bread()/breada() getblk() getblk() getblk() -> -> Buffer Buffer Cache Cache (On (On RAM) RAM) ll_rw_block() ll_rw_block() -> -> Block Block Device Device Driver Driver Handler Handler

struct buffer_head { struct buffer_head *b_next; unsigned long b_blocknr; unsigned short b_size; unsigned short b_list; kdev_t b_dev; atomic_t b_count; kdev_t b_rdev; unsigned long b_state; unsigned long b_flushtime; /* /* /* /* /* ID /* /*real ID /* ( ) /*dirty struct buffer_head *b_next_free; /* struct buffer_head *b_prev_free; /* struct buffer_head *b_this_page; /* struct buffer_head *b_reqnext; /*Request struct buffer_head **b_pprev; /* char *b_data; /* struct page *b_page; /* mappingpage void (*b_end_io) (struct buffer_head * bh, int uptodate); /*I/O routine void *b_private; /* ID unsigned long b_resector; wait_queue_head_t b_wait; /* /* wait }; struct inode *b_inode; /* inode struct list_head b_inode_buffers; /*

BH_Uptodate BH_Dirty (write ) BH_Lock lock( ) BH_Req request,, BH_Mapped mapping BH_New, write BH_Protected protected ( free ) b_dev& b_rdev RAID(Redundant Array of Independent Disk) (, )

struct blk_dev_struct{ request_queue_t request_queue; queue_proc *queue; void *data; };

struct request { struct list_head queue; int elevator_sequence; struct list_head table; struct list_head *free_list; volatile int rq_status; #define RQ_INACTIVE (-1) #define RQ_ACTIVE 1 #define RQ_SCSI_BUSY 0xffff #define RQ_SCSI_DONE 0xfffe #define RQ_SCSI_DISCONNECTING /* /*elevator sequence /* /* /* 0xffe0 }; kdev_t rq_dev; /* ID int cmd; /* (read/write) int errors; /* unsigned long sector; /*sector unsigned long nr_sectors; /* sector unsigned long hard_sectors, hard_nr_sectors; /* sector sector unsigned int nr_segments; /*segment unsigned int nr_hw_segments; /* hw_segment unsigned long current_nr_sectors; /* sector void *special; /* char *buffer; /*I/O struct semaphore *sem; /* struct buffer_head *bh; /* struct buffer_head *bhtail; /* request_queue_t *q; /* elevator_t *e; /*elevator algorithm

typedef struct request_queue request_queue_t; typedef request_queue_t *(queue_proc) (kdev_t dev); struct request_queue { struct list_head request_freelist[2]; struct list_head queue_head; elevator_t elelvator; request_fn_proc *request_fn; merge_request_fn *black_merge_fn; merge_request_fn *front_merge_fn; merge_requests_fn *merge_requests_fn; make_request_fn *make_request_fn; plug_device_fn *plug_device_fn; void *queuedata; }; struct tq_struct plug_tq; char plugged; char head_active; spinlock_t request_lock; wait_queue_head_t wait_for_request;

static inline void blkdev_dequeue_request (struct request *req) { if (req -> e){ req -> e -> dequeue_fn(req); req -> e = NULL; } list_del (&req -> queue); } static inline void end_request(int uptodate){ struct request *req = CURRENT; if ( end_that_request_first(req, uptodate, DEVICE_NAME)) return; #ifdef DEVICE_NO_RANDOM add_blkdev_randomness(major(req -> req_dev)); #endif DEVICE_OFF(req -> rq_dev); blkdev_dequeue_requst(req); end_that_request_last(req); } /* blkdev_dequeue_request(), end_request()