Ver Fonte

2.035u-init: update

rain há 5 anos atrás
pai
commit
aa2e43f6d5
4 ficheiros alterados com 29 adições e 2 exclusões
  1. 1 0
      LINES
  2. 2 2
      Makefile
  3. 4 0
      README.md
  4. 22 0
      include/kernel/init.h

+ 1 - 0
LINES

@@ -10,4 +10,5 @@
 2021-6-02 2.015: 2015 lines, 21 files, rain
 2021-6-15 2.156: 2156 lines, 21 files, rain
 2021-6-20 2.040: 2040 lines, 25 files, rain
+2021-7-04 2.035: 2035 lines, 25 files, rain
 

+ 2 - 2
Makefile

@@ -31,11 +31,11 @@ xnix.img: boot/bootsect $(KSRCS) $(KOBJS) Makefile kbinary
 	dd if=kbinary of=xnix.img conv=notrunc bs=512 seek=2
 
 
-lines: Makefile $(KSRCS)
+lines: 
 	wc -l `find ./ -name *.asm -o -name *.c -o -name *.h -o -name *.S -o -name *.s`
 
 
-clear: Makefile
+clear: 
 	make -C boot/ clear
 	make -C init/ clear
 	make -C kernel/ clear

+ 4 - 0
README.md

@@ -55,3 +55,7 @@ source software, you can get its source code from <https://gitee.com/pengruiyang
 
 2.040u-modules:  
 &nbsp;&nbsp;&nbsp;&nbsp;now we use graphic.c to display PSF font on VGA 320x200 screen. (but it just can display upper characters, can't display some lower character)
+
+2.035u-init:  
+&nbsp;&nbsp;&nbsp;&nbsp;`fd` also need a `inode_descriptor`, but we forgot it. update it again. 
+

+ 22 - 0
include/kernel/init.h

@@ -37,6 +37,28 @@
 #define SEEK_CUR 0x0002
 #define SEEK_END 0x0003
 
+
+
+struct inode_desc {
+	/* this struct is a general descriptor, so we must know
+	 * how big is it. */
+
+	__uint32_t size;
+
+	/* file descriptor */
+	__uint32_t fd;
+
+	/* this is optional (offset) */
+	__uint32_t off;
+
+	/* this is optional too */
+	char *name;
+
+	/* real inode saves here */
+	void *real_inode;
+};
+
+
 struct file_opt {
 	/* open a file */
 	int (* open) (char *, __uint32_t, __uint32_t, errno_t *);