file_operations.에서

quintus의 이미지

404 static struct file_operations input_fops = {
405         owner: THIS_MODULE,
406         open: input_open_file,
407 };

위에서 나온 owner: 의 콜론은 언제 쓰이는거죠?

file_operations 구조체중 open 에 해당하는 함수 포인터인 건 짐작이 가는데

C 책 뒤져 보면. goto 문의 label 일 때 쓰이는거 이외에는
콜론의 쓰임새를 찾을 수가 없어서요.

860 struct file_operations {
861         struct module *owner;
862         loff_t (*llseek) (struct file *, loff_t, int);
863         ssize_t (*read) (struct file *, char *, size_t, loff_t *);
864         ssize_t (*write) (struct file *, const char *, size_t, loff_t *);
865         int (*readdir) (struct file *, void *, filldir_t);
866         unsigned int (*poll) (struct file *, struct poll_table_struct *);
867         int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long);
868         int (*mmap) (struct file *, struct vm_area_struct *);
869         int (*open) (struct inode *, struct file *);
870         int (*flush) (struct file *);
871         int (*release) (struct inode *, struct file *);
872         int (*fsync) (struct file *, struct dentry *, int datasync);
873         int (*fasync) (int, struct file *, int);
874         int (*lock) (struct file *, int, struct file_lock *);
875         ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *);
876         ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *);
877         ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
878         unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
879 };

arch/i386/kernel/traps.c 안에 있는

struct desc_struct idt_table[256] __attribute__((__section__(".data.idt"))) = { {0, 0}, };

의 내용을 보고 싶은데 어찌 해야 하는지요?

아래 부분이 그 내용인듯 싶은데, 19번 이상은 어디서 보아야하지요?

966         set_trap_gate(0,&divide_error);
967         set_trap_gate(1,&debug);
968         set_intr_gate(2,&nmi);
969         set_system_gate(3,&int3);       /* int3-5 can be called from all */
970         set_system_gate(4,&overflow);
971         set_system_gate(5,&bounds);
972         set_trap_gate(6,&invalid_op);
973         set_trap_gate(7,&device_not_available);
974         set_trap_gate(8,&double_fault);
975         set_trap_gate(9,&coprocessor_segment_overrun);
976         set_trap_gate(10,&invalid_TSS);
977         set_trap_gate(11,&segment_not_present);
978         set_trap_gate(12,&stack_segment);
979         set_trap_gate(13,&general_protection);
980         set_intr_gate(14,&page_fault);
981         set_trap_gate(15,&spurious_interrupt_bug);
982         set_trap_gate(16,&coprocessor_error);
983         set_trap_gate(17,&alignment_check);
984         set_trap_gate(18,&machine_check);
985         set_trap_gate(19,&simd_coprocessor_error);
986 
987         set_system_gate(SYSCALL_VECTOR,&system_call);
988 
989         /*
990          * default LDT is a single-entry callgate to lcall7 for iBCS
991          * and a callgate to lcall27 for Solaris/x86 binaries
992          */
993         set_call_gate(&default_ldt[0],lcall7);
994         set_call_gate(&default_ldt[4],lcall27);
pastime의 이미지

404 static struct file_operations input_fops = {
405         owner: THIS_MODULE,
406         open: input_open_file,
407 };

GCC 에서 제공하는 기능으로 구조체 멤버 중에서 원하는 값만을 초기화할 때 사용하는 방법입니다.
2.6 커널에서는 아래와 같이 C 언어에서 표준적으로 제공하는 방법을 사용합니다.

573 static struct file_operations input_fops = {
574         .owner = THIS_MODULE,
575         .open = input_open_file,
576 };

리눅스에서는 0 부터 31 까지의 예외와 NMI 벡터 중에서 19번 까지만 사용하고 있습니다.
32 번 부터는 하드웨어 인터럽트 (IRQ) 에서 사용하고 있으며
이는 request_irq() 함수를 검색해서 찾아볼 수 있습니다.

익명 사용자의 이미지

제가 알기론 어떤 구조체의 값을 바로 지정해서 집어넣는걸 의미합니다.

구조체.멤버변수 = 어쩌구;

이런식이 아니라 선언하면서 바로

멤버변수 : 어쩌구;
이렇게 넣어버린다는 고운 하루되세요.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.