【发布时间】:2011-03-11 16:42:53
【问题描述】:
我正在研究内核架构及其编程以了解有关内核的想法。 我知道 C 编程,但内核代码中提到的结构和指针让我头疼。如下所示
int irq = regs.orig_eax & 0xff;
asmlinkage int handle_IRQ_event(unsigned int irq, struct pt_regs *regs,
struct irqaction *action)
{
struct super_operations {
struct inode *(*alloc_inode) (struct super_block *sb);
void (*destroy_inode) (struct inode *);
void (*read_inode) (struct inode *);
void (*dirty_inode) (struct inode *);
void (*write_inode) (struct inode *, int);
void (*put_inode) (struct inode *);
void (*drop_inode) (struct inode *);
void (*delete_inode) (struct inode *);
void (*put_super) (struct super_block *);
void (*write_super) (struct super_block *);
int (*sync_fs) (struct super_block *, int);
void (*write_super_lockfs) (struct super_block *);
void (*unlockfs) (struct super_block *);
int (*statfs) (struct super_block *, struct statfs *);
int (*remount_fs) (struct super_block *, int *, char *);
void (*clear_inode) (struct inode *);
void (*umount_begin) (struct super_block *);
int (*show_options) (struct seq_file *, struct vfsmount *);
};
如何更好地理解代码。任何教授指针、结构的书,比如内核代码
【问题讨论】:
-
我可能错了,但这在 Stack Overflow 上不是更好吗?
标签: c linux-kernel