From ff2dbb91e1338a1d7c5d339bbdc3774fafb94d6c Mon Sep 17 00:00:00 2001 From: pjht Date: Sun, 23 Aug 2020 14:05:38 -0500 Subject: [PATCH] Add a tar fs driver and posix_spawn --- Makefile | 6 +- devfs/main.c | 1 + init/dump | 3944 +++++++++++++++++++++++++++++++++++++++++++++++ init/main.c | 42 +- libc/spawn.c | 36 + libc/spawn.h | 12 + libc/stdio.c | 3 + libc/stdlib.c | 2 +- tar_fs/Makefile | 13 + tar_fs/main.c | 139 ++ tar_fs/tar_fs | Bin 0 -> 35212 bytes vfs/main.c | 2 + 12 files changed, 4165 insertions(+), 35 deletions(-) create mode 100644 init/dump create mode 100644 libc/spawn.c create mode 100644 libc/spawn.h create mode 100644 tar_fs/Makefile create mode 100644 tar_fs/main.c create mode 100755 tar_fs/tar_fs diff --git a/Makefile b/Makefile index d2c0938..f8cbae5 100644 --- a/Makefile +++ b/Makefile @@ -34,7 +34,7 @@ debug: os.iso kernel/kernel.elf gdb #gdbgui -g i386-elf-gdb --project $(CWD) -os.iso: kernel/kernel.elf init vfs devfs vga_drv initrd_drv sysroot/usr/share/man # vfs devfs initrd vga_drv initrd_drv pci +os.iso: kernel/kernel.elf init vfs devfs vga_drv initrd_drv tar_fs sysroot/usr/share/man # vfs devfs initrd vga_drv initrd_drv pci @cp kernel/kernel.elf sysroot/boot @cd initrd; tar -f ../sysroot/boot/initrd.tar -c * @grub-mkrescue -o $@ sysroot >/dev/null 2>/dev/null @@ -66,6 +66,10 @@ initrd_drv: crts libc @cd $@ && make @cp $@/$@ initrd/$@ +tar_fs: crts libc + @cd $@ && make + @cp $@/$@ initrd/$@ + kernel/kernel.elf: $(OBJ) $(ASM_OBJ) $(S_ASM_OBJ) sysroot/usr/lib/libc.a @$(CC) -z max-page-size=4096 -Xlinker -n -T kernel/cpu/$(PLAT)/linker.ld -o $@ $(CFLAGS) -nostdlib $^ -lgcc diff --git a/devfs/main.c b/devfs/main.c index 09793bd..d921d01 100644 --- a/devfs/main.c +++ b/devfs/main.c @@ -26,6 +26,7 @@ void open(void* args) { serdes_state state; start_deserialize(args,&state); char* path=deserialize_str(&state); + deserialize_ptr(&state); rpc_deallocate_buf(args,state.sizeorpos); int i; char found=0; diff --git a/init/dump b/init/dump new file mode 100644 index 0000000..e70de28 --- /dev/null +++ b/init/dump @@ -0,0 +1,3944 @@ + +init: file format elf32-i386 + + +Disassembly of section .init: + +08048074 <_init>: + 8048074: e8 ff 00 00 00 call 8048178 + 8048079: e8 1a 1f 00 00 call 8049f98 <__do_global_ctors_aux> + 804807e: c2 00 00 ret $0x0 + +Disassembly of section .text: + +08048090 <_start>: + 8048090: e8 06 09 00 00 call 804899b <__stdio_init> + 8048095: e8 f5 04 00 00 call 804858f
+ 804809a: 6a 00 push $0x0 + 804809c: e8 a7 1b 00 00 call 8049c48 + 80480a1: c3 ret + 80480a2: 66 90 xchg %ax,%ax + +080480a4 : + 80480a4: b8 14 b0 04 08 mov $0x804b014,%eax + 80480a9: 3d 14 b0 04 08 cmp $0x804b014,%eax + 80480ae: 74 1c je 80480cc + 80480b0: b8 00 00 00 00 mov $0x0,%eax + 80480b5: 85 c0 test %eax,%eax + 80480b7: 74 13 je 80480cc + 80480b9: 55 push %ebp + 80480ba: 89 e5 mov %esp,%ebp + 80480bc: 83 ec 14 sub $0x14,%esp + 80480bf: 68 14 b0 04 08 push $0x804b014 + 80480c4: ff d0 call *%eax + 80480c6: 83 c4 10 add $0x10,%esp + 80480c9: c9 leave + 80480ca: c3 ret + 80480cb: 90 nop + 80480cc: c3 ret + 80480cd: 8d 76 00 lea 0x0(%esi),%esi + +080480d0 : + 80480d0: b8 14 b0 04 08 mov $0x804b014,%eax + 80480d5: 2d 14 b0 04 08 sub $0x804b014,%eax + 80480da: 89 c2 mov %eax,%edx + 80480dc: c1 fa 02 sar $0x2,%edx + 80480df: c1 e8 1f shr $0x1f,%eax + 80480e2: 01 d0 add %edx,%eax + 80480e4: d1 f8 sar %eax + 80480e6: 74 1c je 8048104 + 80480e8: ba 00 00 00 00 mov $0x0,%edx + 80480ed: 85 d2 test %edx,%edx + 80480ef: 74 13 je 8048104 + 80480f1: 55 push %ebp + 80480f2: 89 e5 mov %esp,%ebp + 80480f4: 83 ec 10 sub $0x10,%esp + 80480f7: 50 push %eax + 80480f8: 68 14 b0 04 08 push $0x804b014 + 80480fd: ff d2 call *%edx + 80480ff: 83 c4 10 add $0x10,%esp + 8048102: c9 leave + 8048103: c3 ret + 8048104: c3 ret + 8048105: 8d 76 00 lea 0x0(%esi),%esi + +08048108 <__do_global_dtors_aux>: + 8048108: 80 3d 20 b0 04 08 00 cmpb $0x0,0x804b020 + 804810f: 75 63 jne 8048174 <__do_global_dtors_aux+0x6c> + 8048111: 55 push %ebp + 8048112: 89 e5 mov %esp,%ebp + 8048114: 56 push %esi + 8048115: 53 push %ebx + 8048116: bb 0c b0 04 08 mov $0x804b00c,%ebx + 804811b: 81 eb 08 b0 04 08 sub $0x804b008,%ebx + 8048121: c1 fb 02 sar $0x2,%ebx + 8048124: 4b dec %ebx + 8048125: be 08 b0 04 08 mov $0x804b008,%esi + 804812a: a1 24 b0 04 08 mov 0x804b024,%eax + 804812f: 39 d8 cmp %ebx,%eax + 8048131: 73 13 jae 8048146 <__do_global_dtors_aux+0x3e> + 8048133: 90 nop + 8048134: 40 inc %eax + 8048135: a3 24 b0 04 08 mov %eax,0x804b024 + 804813a: ff 14 86 call *(%esi,%eax,4) + 804813d: a1 24 b0 04 08 mov 0x804b024,%eax + 8048142: 39 d8 cmp %ebx,%eax + 8048144: 72 ee jb 8048134 <__do_global_dtors_aux+0x2c> + 8048146: e8 59 ff ff ff call 80480a4 + 804814b: b8 00 00 00 00 mov $0x0,%eax + 8048150: 85 c0 test %eax,%eax + 8048152: 74 10 je 8048164 <__do_global_dtors_aux+0x5c> + 8048154: 83 ec 0c sub $0xc,%esp + 8048157: 68 a4 a1 04 08 push $0x804a1a4 + 804815c: e8 9f 7e fb f7 call 0 <_init-0x8048074> + 8048161: 83 c4 10 add $0x10,%esp + 8048164: c6 05 20 b0 04 08 01 movb $0x1,0x804b020 + 804816b: 8d 65 f8 lea -0x8(%ebp),%esp + 804816e: 5b pop %ebx + 804816f: 5e pop %esi + 8048170: 5d pop %ebp + 8048171: c3 ret + 8048172: 66 90 xchg %ax,%ax + 8048174: c3 ret + 8048175: 8d 76 00 lea 0x0(%esi),%esi + +08048178 : + 8048178: b8 00 00 00 00 mov $0x0,%eax + 804817d: 85 c0 test %eax,%eax + 804817f: 74 1f je 80481a0 + 8048181: 55 push %ebp + 8048182: 89 e5 mov %esp,%ebp + 8048184: 83 ec 10 sub $0x10,%esp + 8048187: 68 28 b0 04 08 push $0x804b028 + 804818c: 68 a4 a1 04 08 push $0x804a1a4 + 8048191: e8 6a 7e fb f7 call 0 <_init-0x8048074> + 8048196: 83 c4 10 add $0x10,%esp + 8048199: c9 leave + 804819a: e9 31 ff ff ff jmp 80480d0 + 804819f: 90 nop + 80481a0: e9 2b ff ff ff jmp 80480d0 + +080481a5 : + char mtime[12]; + char chksum[8]; + char typeflag[1]; +} tar_header; + +size_t getsize(const char *in) { + 80481a5: 55 push %ebp + 80481a6: 89 e5 mov %esp,%ebp + 80481a8: 83 ec 10 sub $0x10,%esp + size_t size=0; + 80481ab: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) + size_t j; + size_t count=1; + 80481b2: c7 45 f4 01 00 00 00 movl $0x1,-0xc(%ebp) + for (j=11;j>0;j--,count*=8) { + 80481b9: c7 45 f8 0b 00 00 00 movl $0xb,-0x8(%ebp) + 80481c0: eb 21 jmp 80481e3 + size+=((in[j-1]-'0')*count); + 80481c2: 8b 45 f8 mov -0x8(%ebp),%eax + 80481c5: 8d 50 ff lea -0x1(%eax),%edx + 80481c8: 8b 45 08 mov 0x8(%ebp),%eax + 80481cb: 01 d0 add %edx,%eax + 80481cd: 8a 00 mov (%eax),%al + 80481cf: 0f be c0 movsbl %al,%eax + 80481d2: 83 e8 30 sub $0x30,%eax + 80481d5: 0f af 45 f4 imul -0xc(%ebp),%eax + 80481d9: 01 45 fc add %eax,-0x4(%ebp) + for (j=11;j>0;j--,count*=8) { + 80481dc: ff 4d f8 decl -0x8(%ebp) + 80481df: c1 65 f4 03 shll $0x3,-0xc(%ebp) + 80481e3: 83 7d f8 00 cmpl $0x0,-0x8(%ebp) + 80481e7: 75 d9 jne 80481c2 + } + return size; + 80481e9: 8b 45 fc mov -0x4(%ebp),%eax +} + 80481ec: c9 leave + 80481ed: c3 ret + +080481ee : + +size_t find_loc(char* name,char* initrd) { + 80481ee: 55 push %ebp + 80481ef: 89 e5 mov %esp,%ebp + 80481f1: 81 ec c8 00 00 00 sub $0xc8,%esp + size_t pos=0; + 80481f7: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) + tar_header tar_hdr; + for (int i=0;;i++) { + 80481fe: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) + char* tar_hdr_ptr=(char*)&tar_hdr; + 8048205: 8d 85 47 ff ff ff lea -0xb9(%ebp),%eax + 804820b: 89 45 e8 mov %eax,-0x18(%ebp) + for (size_t i=0;i + tar_hdr_ptr[i]=initrd[pos+i]; + 8048217: 8b 55 f4 mov -0xc(%ebp),%edx + 804821a: 8b 45 ec mov -0x14(%ebp),%eax + 804821d: 01 c2 add %eax,%edx + 804821f: 8b 45 0c mov 0xc(%ebp),%eax + 8048222: 01 d0 add %edx,%eax + 8048224: 8b 4d e8 mov -0x18(%ebp),%ecx + 8048227: 8b 55 ec mov -0x14(%ebp),%edx + 804822a: 01 ca add %ecx,%edx + 804822c: 8a 00 mov (%eax),%al + 804822e: 88 02 mov %al,(%edx) + for (size_t i=0;i + } + if (tar_hdr.filename[0]=='\0') break; + 804823c: 8a 85 47 ff ff ff mov -0xb9(%ebp),%al + 8048242: 84 c0 test %al,%al + 8048244: 74 64 je 80482aa + size_t size=getsize(tar_hdr.size); + 8048246: 8d 85 47 ff ff ff lea -0xb9(%ebp),%eax + 804824c: 83 c0 7c add $0x7c,%eax + 804824f: 50 push %eax + 8048250: e8 50 ff ff ff call 80481a5 + 8048255: 83 c4 04 add $0x4,%esp + 8048258: 89 45 e4 mov %eax,-0x1c(%ebp) + pos+=512; + 804825b: 81 45 f4 00 02 00 00 addl $0x200,-0xc(%ebp) + if (strcmp(tar_hdr.filename,name)==0) { + 8048262: 83 ec 08 sub $0x8,%esp + 8048265: ff 75 08 pushl 0x8(%ebp) + 8048268: 8d 85 47 ff ff ff lea -0xb9(%ebp),%eax + 804826e: 50 push %eax + 804826f: e8 64 15 00 00 call 80497d8 + 8048274: 83 c4 10 add $0x10,%esp + 8048277: 85 c0 test %eax,%eax + 8048279: 75 05 jne 8048280 + return pos; + 804827b: 8b 45 f4 mov -0xc(%ebp),%eax + 804827e: eb 30 jmp 80482b0 + break; + } + pos+=size; + 8048280: 8b 45 e4 mov -0x1c(%ebp),%eax + 8048283: 01 45 f4 add %eax,-0xc(%ebp) + if (pos%512!=0) { + 8048286: 8b 45 f4 mov -0xc(%ebp),%eax + 8048289: 25 ff 01 00 00 and $0x1ff,%eax + 804828e: 85 c0 test %eax,%eax + 8048290: 74 10 je 80482a2 + pos+=512-(pos%512); + 8048292: 8b 45 f4 mov -0xc(%ebp),%eax + 8048295: 25 00 fe ff ff and $0xfffffe00,%eax + 804829a: 05 00 02 00 00 add $0x200,%eax + 804829f: 89 45 f4 mov %eax,-0xc(%ebp) + for (int i=0;;i++) { + 80482a2: ff 45 f0 incl -0x10(%ebp) + 80482a5: e9 5b ff ff ff jmp 8048205 + if (tar_hdr.filename[0]=='\0') break; + 80482aa: 90 nop + } + } + return 0; + 80482ab: b8 00 00 00 00 mov $0x0,%eax +} + 80482b0: c9 leave + 80482b1: c3 ret + +080482b2 : + +char load_proc(size_t datapos,char* initrd) { + 80482b2: 55 push %ebp + 80482b3: 89 e5 mov %esp,%ebp + 80482b5: 81 ec 88 00 00 00 sub $0x88,%esp + int pos=0; + 80482bb: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) + elf_header header; + pos=datapos; + 80482c2: 8b 45 08 mov 0x8(%ebp),%eax + 80482c5: 89 45 f4 mov %eax,-0xc(%ebp) + char* hdr_ptr=(char*)&header; + 80482c8: 8d 45 a0 lea -0x60(%ebp),%eax + 80482cb: 89 45 e0 mov %eax,-0x20(%ebp) + for (size_t i=0;i + hdr_ptr[i]=initrd[pos]; + 80482d7: 8b 55 f4 mov -0xc(%ebp),%edx + 80482da: 8b 45 0c mov 0xc(%ebp),%eax + 80482dd: 01 d0 add %edx,%eax + 80482df: 8b 4d e0 mov -0x20(%ebp),%ecx + 80482e2: 8b 55 f0 mov -0x10(%ebp),%edx + 80482e5: 01 ca add %ecx,%edx + 80482e7: 8a 00 mov (%eax),%al + 80482e9: 88 02 mov %al,(%edx) + pos++; + 80482eb: ff 45 f4 incl -0xc(%ebp) + for (size_t i=0;i + } + if (header.magic!=ELF_MAGIC) { + 80482f7: 8b 45 a0 mov -0x60(%ebp),%eax + 80482fa: 3d 7f 45 4c 46 cmp $0x464c457f,%eax + 80482ff: 74 07 je 8048308 + return 0; + 8048301: b0 00 mov $0x0,%al + 8048303: e9 01 01 00 00 jmp 8048409 + } else { + void* address_space=new_address_space(); + 8048308: e8 ff 05 00 00 call 804890c + 804830d: 89 45 dc mov %eax,-0x24(%ebp) + for (int i=0;i + elf_pheader pheader; + pos=(header.prog_hdr)+(header.pheader_ent_sz*i)+datapos; + 804831c: 8b 55 bc mov -0x44(%ebp),%edx + 804831f: 66 8b 45 ca mov -0x36(%ebp),%ax + 8048323: 0f b7 c0 movzwl %ax,%eax + 8048326: 0f af 45 ec imul -0x14(%ebp),%eax + 804832a: 01 c2 add %eax,%edx + 804832c: 8b 45 08 mov 0x8(%ebp),%eax + 804832f: 01 d0 add %edx,%eax + 8048331: 89 45 f4 mov %eax,-0xc(%ebp) + char* phdr_ptr=(char*)&pheader; + 8048334: 8d 45 80 lea -0x80(%ebp),%eax + 8048337: 89 45 d8 mov %eax,-0x28(%ebp) + for (size_t i=0;i + phdr_ptr[i]=initrd[pos]; + 8048343: 8b 55 f4 mov -0xc(%ebp),%edx + 8048346: 8b 45 0c mov 0xc(%ebp),%eax + 8048349: 01 d0 add %edx,%eax + 804834b: 8b 4d d8 mov -0x28(%ebp),%ecx + 804834e: 8b 55 e8 mov -0x18(%ebp),%edx + 8048351: 01 ca add %ecx,%edx + 8048353: 8a 00 mov (%eax),%al + 8048355: 88 02 mov %al,(%edx) + pos++; + 8048357: ff 45 f4 incl -0xc(%ebp) + for (size_t i=0;i + } + char* ptr=alloc_memory(((pheader.memsz)/4096)+1); + 8048363: 8b 45 94 mov -0x6c(%ebp),%eax + 8048366: c1 e8 0c shr $0xc,%eax + 8048369: 40 inc %eax + 804836a: 83 ec 0c sub $0xc,%esp + 804836d: 50 push %eax + 804836e: e8 58 05 00 00 call 80488cb + 8048373: 83 c4 10 add $0x10,%esp + 8048376: 89 45 d4 mov %eax,-0x2c(%ebp) + memset(ptr,0,pheader.memsz); + 8048379: 8b 45 94 mov -0x6c(%ebp),%eax + 804837c: 83 ec 04 sub $0x4,%esp + 804837f: 50 push %eax + 8048380: 6a 00 push $0x0 + 8048382: ff 75 d4 pushl -0x2c(%ebp) + 8048385: e8 1c 14 00 00 call 80497a6 + 804838a: 83 c4 10 add $0x10,%esp + if (pheader.filesz>0) { + 804838d: 8b 45 90 mov -0x70(%ebp),%eax + 8048390: 85 c0 test %eax,%eax + 8048392: 74 36 je 80483ca + pos=pheader.offset+datapos; + 8048394: 8b 55 84 mov -0x7c(%ebp),%edx + 8048397: 8b 45 08 mov 0x8(%ebp),%eax + 804839a: 01 d0 add %edx,%eax + 804839c: 89 45 f4 mov %eax,-0xc(%ebp) + for (size_t i=0;i + ptr[i]=initrd[pos]; + 80483a8: 8b 55 f4 mov -0xc(%ebp),%edx + 80483ab: 8b 45 0c mov 0xc(%ebp),%eax + 80483ae: 01 d0 add %edx,%eax + 80483b0: 8b 4d d4 mov -0x2c(%ebp),%ecx + 80483b3: 8b 55 e4 mov -0x1c(%ebp),%edx + 80483b6: 01 ca add %ecx,%edx + 80483b8: 8a 00 mov (%eax),%al + 80483ba: 88 02 mov %al,(%edx) + pos++; + 80483bc: ff 45 f4 incl -0xc(%ebp) + for (size_t i=0;i + } + } + copy_data(address_space,ptr,pheader.memsz,(void*)pheader.vaddr); + 80483ca: 8b 45 88 mov -0x78(%ebp),%eax + 80483cd: 89 c2 mov %eax,%edx + 80483cf: 8b 45 94 mov -0x6c(%ebp),%eax + 80483d2: 52 push %edx + 80483d3: 50 push %eax + 80483d4: ff 75 d4 pushl -0x2c(%ebp) + 80483d7: ff 75 dc pushl -0x24(%ebp) + 80483da: e8 49 05 00 00 call 8048928 + 80483df: 83 c4 10 add $0x10,%esp + for (int i=0;i + } + create_proc((void*)header.entry,address_space,NULL,NULL); + 80483f4: 8b 45 b8 mov -0x48(%ebp),%eax + 80483f7: 6a 00 push $0x0 + 80483f9: 6a 00 push $0x0 + 80483fb: ff 75 dc pushl -0x24(%ebp) + 80483fe: 50 push %eax + 80483ff: e8 25 18 00 00 call 8049c29 + 8048404: 83 c4 10 add $0x10,%esp + } + return 1; + 8048407: b0 01 mov $0x1,%al +} + 8048409: c9 leave + 804840a: c3 ret + +0804840b : + +char load_proc_devfs(size_t datapos) { + 804840b: 55 push %ebp + 804840c: 89 e5 mov %esp,%ebp + 804840e: 83 ec 78 sub $0x78,%esp + FILE* initrd=fopen("/dev/initrd","r"); + 8048411: 83 ec 08 sub $0x8,%esp + 8048414: 68 c8 9f 04 08 push $0x8049fc8 + 8048419: 68 ca 9f 04 08 push $0x8049fca + 804841e: e8 7e 05 00 00 call 80489a1 + 8048423: 83 c4 10 add $0x10,%esp + 8048426: 89 45 f0 mov %eax,-0x10(%ebp) + elf_header header; + fseek(initrd,datapos,SEEK_SET); + 8048429: 8b 45 08 mov 0x8(%ebp),%eax + 804842c: 83 ec 04 sub $0x4,%esp + 804842f: 6a 03 push $0x3 + 8048431: 50 push %eax + 8048432: ff 75 f0 pushl -0x10(%ebp) + 8048435: e8 c6 0d 00 00 call 8049200 + 804843a: 83 c4 10 add $0x10,%esp + fread(&header,sizeof(elf_header),1,initrd); + 804843d: ff 75 f0 pushl -0x10(%ebp) + 8048440: 6a 01 push $0x1 + 8048442: 6a 34 push $0x34 + 8048444: 8d 45 b4 lea -0x4c(%ebp),%eax + 8048447: 50 push %eax + 8048448: e8 0c 07 00 00 call 8048b59 + 804844d: 83 c4 10 add $0x10,%esp + if (header.magic!=ELF_MAGIC) { + 8048450: 8b 45 b4 mov -0x4c(%ebp),%eax + 8048453: 3d 7f 45 4c 46 cmp $0x464c457f,%eax + 8048458: 74 49 je 80484a3 + serial_print("Bad magic number ("); + 804845a: 83 ec 0c sub $0xc,%esp + 804845d: 68 d6 9f 04 08 push $0x8049fd6 + 8048462: e8 20 04 00 00 call 8048887 + 8048467: 83 c4 10 add $0x10,%esp + char str[32]; + hex_to_ascii(header.magic,str); + 804846a: 8b 45 b4 mov -0x4c(%ebp),%eax + 804846d: 83 ec 08 sub $0x8,%esp + 8048470: 8d 55 94 lea -0x6c(%ebp),%edx + 8048473: 52 push %edx + 8048474: 50 push %eax + 8048475: e8 18 15 00 00 call 8049992 + 804847a: 83 c4 10 add $0x10,%esp + serial_print(str); + 804847d: 83 ec 0c sub $0xc,%esp + 8048480: 8d 45 94 lea -0x6c(%ebp),%eax + 8048483: 50 push %eax + 8048484: e8 fe 03 00 00 call 8048887 + 8048489: 83 c4 10 add $0x10,%esp + serial_print(")\n"); + 804848c: 83 ec 0c sub $0xc,%esp + 804848f: 68 e9 9f 04 08 push $0x8049fe9 + 8048494: e8 ee 03 00 00 call 8048887 + 8048499: 83 c4 10 add $0x10,%esp + return 0; + 804849c: b0 00 mov $0x0,%al + 804849e: e9 ea 00 00 00 jmp 804858d + } else { + void* address_space=new_address_space(); + 80484a3: e8 64 04 00 00 call 804890c + 80484a8: 89 45 ec mov %eax,-0x14(%ebp) + for (int i=0;i + elf_pheader pheader; + fseek(initrd,(header.prog_hdr)+(header.pheader_ent_sz*i)+datapos,SEEK_SET); + 80484b7: 8b 55 d0 mov -0x30(%ebp),%edx + 80484ba: 66 8b 45 de mov -0x22(%ebp),%ax + 80484be: 0f b7 c0 movzwl %ax,%eax + 80484c1: 0f af 45 f4 imul -0xc(%ebp),%eax + 80484c5: 01 c2 add %eax,%edx + 80484c7: 8b 45 08 mov 0x8(%ebp),%eax + 80484ca: 01 d0 add %edx,%eax + 80484cc: 83 ec 04 sub $0x4,%esp + 80484cf: 6a 03 push $0x3 + 80484d1: 50 push %eax + 80484d2: ff 75 f0 pushl -0x10(%ebp) + 80484d5: e8 26 0d 00 00 call 8049200 + 80484da: 83 c4 10 add $0x10,%esp + fread(&pheader,sizeof(elf_pheader),1,initrd); + 80484dd: ff 75 f0 pushl -0x10(%ebp) + 80484e0: 6a 01 push $0x1 + 80484e2: 6a 20 push $0x20 + 80484e4: 8d 45 94 lea -0x6c(%ebp),%eax + 80484e7: 50 push %eax + 80484e8: e8 6c 06 00 00 call 8048b59 + 80484ed: 83 c4 10 add $0x10,%esp + char* ptr=alloc_memory(((pheader.memsz)/4096)+1); + 80484f0: 8b 45 a8 mov -0x58(%ebp),%eax + 80484f3: c1 e8 0c shr $0xc,%eax + 80484f6: 40 inc %eax + 80484f7: 83 ec 0c sub $0xc,%esp + 80484fa: 50 push %eax + 80484fb: e8 cb 03 00 00 call 80488cb + 8048500: 83 c4 10 add $0x10,%esp + 8048503: 89 45 e8 mov %eax,-0x18(%ebp) + memset(ptr,0,pheader.memsz); + 8048506: 8b 45 a8 mov -0x58(%ebp),%eax + 8048509: 83 ec 04 sub $0x4,%esp + 804850c: 50 push %eax + 804850d: 6a 00 push $0x0 + 804850f: ff 75 e8 pushl -0x18(%ebp) + 8048512: e8 8f 12 00 00 call 80497a6 + 8048517: 83 c4 10 add $0x10,%esp + if (pheader.filesz>0) { + 804851a: 8b 45 a4 mov -0x5c(%ebp),%eax + 804851d: 85 c0 test %eax,%eax + 804851f: 74 2d je 804854e + fseek(initrd,pheader.offset+datapos,SEEK_SET); + 8048521: 8b 55 98 mov -0x68(%ebp),%edx + 8048524: 8b 45 08 mov 0x8(%ebp),%eax + 8048527: 01 d0 add %edx,%eax + 8048529: 83 ec 04 sub $0x4,%esp + 804852c: 6a 03 push $0x3 + 804852e: 50 push %eax + 804852f: ff 75 f0 pushl -0x10(%ebp) + 8048532: e8 c9 0c 00 00 call 8049200 + 8048537: 83 c4 10 add $0x10,%esp + fread(ptr,sizeof(char),pheader.filesz,initrd); + 804853a: 8b 45 a4 mov -0x5c(%ebp),%eax + 804853d: ff 75 f0 pushl -0x10(%ebp) + 8048540: 50 push %eax + 8048541: 6a 01 push $0x1 + 8048543: ff 75 e8 pushl -0x18(%ebp) + 8048546: e8 0e 06 00 00 call 8048b59 + 804854b: 83 c4 10 add $0x10,%esp + } + copy_data(address_space,ptr,pheader.memsz,(void*)pheader.vaddr); + 804854e: 8b 45 9c mov -0x64(%ebp),%eax + 8048551: 89 c2 mov %eax,%edx + 8048553: 8b 45 a8 mov -0x58(%ebp),%eax + 8048556: 52 push %edx + 8048557: 50 push %eax + 8048558: ff 75 e8 pushl -0x18(%ebp) + 804855b: ff 75 ec pushl -0x14(%ebp) + 804855e: e8 c5 03 00 00 call 8048928 + 8048563: 83 c4 10 add $0x10,%esp + for (int i=0;i + } + create_proc((void*)header.entry,address_space,NULL,NULL); + 8048578: 8b 45 cc mov -0x34(%ebp),%eax + 804857b: 6a 00 push $0x0 + 804857d: 6a 00 push $0x0 + 804857f: ff 75 ec pushl -0x14(%ebp) + 8048582: 50 push %eax + 8048583: e8 a1 16 00 00 call 8049c29 + 8048588: 83 c4 10 add $0x10,%esp + } + return 1; + 804858b: b0 01 mov $0x1,%al +} + 804858d: c9 leave + 804858e: c3 ret + +0804858f
: + +int main() { + 804858f: 8d 4c 24 04 lea 0x4(%esp),%ecx + 8048593: 83 e4 f0 and $0xfffffff0,%esp + 8048596: ff 71 fc pushl -0x4(%ecx) + 8048599: 55 push %ebp + 804859a: 89 e5 mov %esp,%ebp + 804859c: 51 push %ecx + 804859d: 83 ec 24 sub $0x24,%esp + serial_print("Init running\n"); + 80485a0: 83 ec 0c sub $0xc,%esp + 80485a3: 68 ec 9f 04 08 push $0x8049fec + 80485a8: e8 da 02 00 00 call 8048887 + 80485ad: 83 c4 10 add $0x10,%esp + long size=initrd_sz(); + 80485b0: e8 e6 02 00 00 call 804889b + 80485b5: 89 45 f4 mov %eax,-0xc(%ebp) + char* initrd=malloc(size); + 80485b8: 8b 45 f4 mov -0xc(%ebp),%eax + 80485bb: 83 ec 0c sub $0xc,%esp + 80485be: 50 push %eax + 80485bf: e8 b9 0e 00 00 call 804947d + 80485c4: 83 c4 10 add $0x10,%esp + 80485c7: 89 45 f0 mov %eax,-0x10(%ebp) + initrd_get(initrd); + 80485ca: 83 ec 0c sub $0xc,%esp + 80485cd: ff 75 f0 pushl -0x10(%ebp) + 80485d0: e8 e2 02 00 00 call 80488b7 + 80485d5: 83 c4 10 add $0x10,%esp + size_t datapos=find_loc("vfs",initrd); + 80485d8: 83 ec 08 sub $0x8,%esp + 80485db: ff 75 f0 pushl -0x10(%ebp) + 80485de: 68 fa 9f 04 08 push $0x8049ffa + 80485e3: e8 06 fc ff ff call 80481ee + 80485e8: 83 c4 10 add $0x10,%esp + 80485eb: 89 45 ec mov %eax,-0x14(%ebp) + load_proc(datapos,initrd); + 80485ee: 83 ec 08 sub $0x8,%esp + 80485f1: ff 75 f0 pushl -0x10(%ebp) + 80485f4: ff 75 ec pushl -0x14(%ebp) + 80485f7: e8 b6 fc ff ff call 80482b2 + 80485fc: 83 c4 10 add $0x10,%esp + while(rpc_is_init(2)==0); + 80485ff: 90 nop + 8048600: 83 ec 0c sub $0xc,%esp + 8048603: 6a 02 push $0x2 + 8048605: e8 2b 17 00 00 call 8049d35 + 804860a: 83 c4 10 add $0x10,%esp + 804860d: 84 c0 test %al,%al + 804860f: 74 ef je 8048600 + datapos=find_loc("devfs",initrd); + 8048611: 83 ec 08 sub $0x8,%esp + 8048614: ff 75 f0 pushl -0x10(%ebp) + 8048617: 68 fe 9f 04 08 push $0x8049ffe + 804861c: e8 cd fb ff ff call 80481ee + 8048621: 83 c4 10 add $0x10,%esp + 8048624: 89 45 ec mov %eax,-0x14(%ebp) + load_proc(datapos,initrd); + 8048627: 83 ec 08 sub $0x8,%esp + 804862a: ff 75 f0 pushl -0x10(%ebp) + 804862d: ff 75 ec pushl -0x14(%ebp) + 8048630: e8 7d fc ff ff call 80482b2 + 8048635: 83 c4 10 add $0x10,%esp + while(rpc_is_init(3)==0); + 8048638: 90 nop + 8048639: 83 ec 0c sub $0xc,%esp + 804863c: 6a 03 push $0x3 + 804863e: e8 f2 16 00 00 call 8049d35 + 8048643: 83 c4 10 add $0x10,%esp + 8048646: 84 c0 test %al,%al + 8048648: 74 ef je 8048639 + int err=mount("","devfs","/dev"); + 804864a: 83 ec 04 sub $0x4,%esp + 804864d: 68 04 a0 04 08 push $0x804a004 + 8048652: 68 fe 9f 04 08 push $0x8049ffe + 8048657: 68 09 a0 04 08 push $0x804a009 + 804865c: e8 7a 08 00 00 call 8048edb + 8048661: 83 c4 10 add $0x10,%esp + 8048664: 89 45 e8 mov %eax,-0x18(%ebp) + if (err) { + 8048667: 83 7d e8 00 cmpl $0x0,-0x18(%ebp) + 804866b: 74 1a je 8048687 + serial_print("Failed to mount devfs\n"); + 804866d: 83 ec 0c sub $0xc,%esp + 8048670: 68 0a a0 04 08 push $0x804a00a + 8048675: e8 0d 02 00 00 call 8048887 + 804867a: 83 c4 10 add $0x10,%esp + exit(1); + 804867d: 83 ec 0c sub $0xc,%esp + 8048680: 6a 01 push $0x1 + 8048682: e8 c1 15 00 00 call 8049c48 + } + datapos=find_loc("initrd_drv",initrd); + 8048687: 83 ec 08 sub $0x8,%esp + 804868a: ff 75 f0 pushl -0x10(%ebp) + 804868d: 68 21 a0 04 08 push $0x804a021 + 8048692: e8 57 fb ff ff call 80481ee + 8048697: 83 c4 10 add $0x10,%esp + 804869a: 89 45 ec mov %eax,-0x14(%ebp) + load_proc(datapos,initrd); + 804869d: 83 ec 08 sub $0x8,%esp + 80486a0: ff 75 f0 pushl -0x10(%ebp) + 80486a3: ff 75 ec pushl -0x14(%ebp) + 80486a6: e8 07 fc ff ff call 80482b2 + 80486ab: 83 c4 10 add $0x10,%esp + while(rpc_is_init(4)==0); + 80486ae: 90 nop + 80486af: 83 ec 0c sub $0xc,%esp + 80486b2: 6a 04 push $0x4 + 80486b4: e8 7c 16 00 00 call 8049d35 + 80486b9: 83 c4 10 add $0x10,%esp + 80486bc: 84 c0 test %al,%al + 80486be: 74 ef je 80486af + serial_print("Loading tar_fs\n"); + 80486c0: 83 ec 0c sub $0xc,%esp + 80486c3: 68 2c a0 04 08 push $0x804a02c + 80486c8: e8 ba 01 00 00 call 8048887 + 80486cd: 83 c4 10 add $0x10,%esp + datapos=find_loc("tar_fs",initrd); + 80486d0: 83 ec 08 sub $0x8,%esp + 80486d3: ff 75 f0 pushl -0x10(%ebp) + 80486d6: 68 3c a0 04 08 push $0x804a03c + 80486db: e8 0e fb ff ff call 80481ee + 80486e0: 83 c4 10 add $0x10,%esp + 80486e3: 89 45 ec mov %eax,-0x14(%ebp) + load_proc(datapos,initrd); + 80486e6: 83 ec 08 sub $0x8,%esp + 80486e9: ff 75 f0 pushl -0x10(%ebp) + 80486ec: ff 75 ec pushl -0x14(%ebp) + 80486ef: e8 be fb ff ff call 80482b2 + 80486f4: 83 c4 10 add $0x10,%esp + while(rpc_is_init(5)==0); + 80486f7: 90 nop + 80486f8: 83 ec 0c sub $0xc,%esp + 80486fb: 6a 05 push $0x5 + 80486fd: e8 33 16 00 00 call 8049d35 + 8048702: 83 c4 10 add $0x10,%esp + 8048705: 84 c0 test %al,%al + 8048707: 74 ef je 80486f8 + serial_print("Mounting initrd\n"); + 8048709: 83 ec 0c sub $0xc,%esp + 804870c: 68 43 a0 04 08 push $0x804a043 + 8048711: e8 71 01 00 00 call 8048887 + 8048716: 83 c4 10 add $0x10,%esp + mount("/dev/initrd","tarfs","/initrd"); + 8048719: 83 ec 04 sub $0x4,%esp + 804871c: 68 54 a0 04 08 push $0x804a054 + 8048721: 68 5c a0 04 08 push $0x804a05c + 8048726: 68 ca 9f 04 08 push $0x8049fca + 804872b: e8 ab 07 00 00 call 8048edb + 8048730: 83 c4 10 add $0x10,%esp + serial_print("Opening file\n"); + 8048733: 83 ec 0c sub $0xc,%esp + 8048736: 68 62 a0 04 08 push $0x804a062 + 804873b: e8 47 01 00 00 call 8048887 + 8048740: 83 c4 10 add $0x10,%esp + FILE* test=fopen("/initrd/hi","r"); + 8048743: 83 ec 08 sub $0x8,%esp + 8048746: 68 c8 9f 04 08 push $0x8049fc8 + 804874b: 68 70 a0 04 08 push $0x804a070 + 8048750: e8 4c 02 00 00 call 80489a1 + 8048755: 83 c4 10 add $0x10,%esp + 8048758: 89 45 e4 mov %eax,-0x1c(%ebp) + serial_print("Reading from file\n"); + 804875b: 83 ec 0c sub $0xc,%esp + 804875e: 68 7b a0 04 08 push $0x804a07b + 8048763: e8 1f 01 00 00 call 8048887 + 8048768: 83 c4 10 add $0x10,%esp + char* str=fread(malloc(7),1,6,test); + 804876b: 83 ec 0c sub $0xc,%esp + 804876e: 6a 07 push $0x7 + 8048770: e8 08 0d 00 00 call 804947d + 8048775: 83 c4 10 add $0x10,%esp + 8048778: ff 75 e4 pushl -0x1c(%ebp) + 804877b: 6a 06 push $0x6 + 804877d: 6a 01 push $0x1 + 804877f: 50 push %eax + 8048780: e8 d4 03 00 00 call 8048b59 + 8048785: 83 c4 10 add $0x10,%esp + 8048788: 89 45 e0 mov %eax,-0x20(%ebp) + str[7]='\0'; + 804878b: 8b 45 e0 mov -0x20(%ebp),%eax + 804878e: 83 c0 07 add $0x7,%eax + 8048791: c6 00 00 movb $0x0,(%eax) + serial_print("Read from file: "); + 8048794: 83 ec 0c sub $0xc,%esp + 8048797: 68 8e a0 04 08 push $0x804a08e + 804879c: e8 e6 00 00 00 call 8048887 + 80487a1: 83 c4 10 add $0x10,%esp + serial_print(str); + 80487a4: 83 ec 0c sub $0xc,%esp + 80487a7: ff 75 e0 pushl -0x20(%ebp) + 80487aa: e8 d8 00 00 00 call 8048887 + 80487af: 83 c4 10 add $0x10,%esp + serial_print("Loading VGA driver\n"); + 80487b2: 83 ec 0c sub $0xc,%esp + 80487b5: 68 9f a0 04 08 push $0x804a09f + 80487ba: e8 c8 00 00 00 call 8048887 + 80487bf: 83 c4 10 add $0x10,%esp + datapos=find_loc("vga_drv",initrd); + 80487c2: 83 ec 08 sub $0x8,%esp + 80487c5: ff 75 f0 pushl -0x10(%ebp) + 80487c8: 68 b3 a0 04 08 push $0x804a0b3 + 80487cd: e8 1c fa ff ff call 80481ee + 80487d2: 83 c4 10 add $0x10,%esp + 80487d5: 89 45 ec mov %eax,-0x14(%ebp) + load_proc_devfs(datapos); + 80487d8: 83 ec 0c sub $0xc,%esp + 80487db: ff 75 ec pushl -0x14(%ebp) + 80487de: e8 28 fc ff ff call 804840b + 80487e3: 83 c4 10 add $0x10,%esp + while(rpc_is_init(6)==0); + 80487e6: 90 nop + 80487e7: 83 ec 0c sub $0xc,%esp + 80487ea: 6a 06 push $0x6 + 80487ec: e8 44 15 00 00 call 8049d35 + 80487f1: 83 c4 10 add $0x10,%esp + 80487f4: 84 c0 test %al,%al + 80487f6: 74 ef je 80487e7 + serial_print("Opening /dev/vga\n"); + 80487f8: 83 ec 0c sub $0xc,%esp + 80487fb: 68 bb a0 04 08 push $0x804a0bb + 8048800: e8 82 00 00 00 call 8048887 + 8048805: 83 c4 10 add $0x10,%esp + stdout=fopen("/dev/vga","w"); + 8048808: 83 ec 08 sub $0x8,%esp + 804880b: 68 cd a0 04 08 push $0x804a0cd + 8048810: 68 cf a0 04 08 push $0x804a0cf + 8048815: e8 87 01 00 00 call 80489a1 + 804881a: 83 c4 10 add $0x10,%esp + 804881d: a3 44 b0 04 08 mov %eax,0x804b044 + if (!stdout) { + 8048822: a1 44 b0 04 08 mov 0x804b044,%eax + 8048827: 85 c0 test %eax,%eax + 8048829: 75 1a jne 8048845 + serial_print("Could not open /dev/vga\n"); + 804882b: 83 ec 0c sub $0xc,%esp + 804882e: 68 d8 a0 04 08 push $0x804a0d8 + 8048833: e8 4f 00 00 00 call 8048887 + 8048838: 83 c4 10 add $0x10,%esp + exit(1); + 804883b: 83 ec 0c sub $0xc,%esp + 804883e: 6a 01 push $0x1 + 8048840: e8 03 14 00 00 call 8049c48 + } + serial_print("Writing to screen\n"); + 8048845: 83 ec 0c sub $0xc,%esp + 8048848: 68 f1 a0 04 08 push $0x804a0f1 + 804884d: e8 35 00 00 00 call 8048887 + 8048852: 83 c4 10 add $0x10,%esp + puts("Puts test"); + 8048855: 83 ec 0c sub $0xc,%esp + 8048858: 68 04 a1 04 08 push $0x804a104 + 804885d: e8 0c 04 00 00 call 8048c6e + 8048862: 83 c4 10 add $0x10,%esp + printf("Printf test with file opened to %s\n","/dev/vga"); + 8048865: 83 ec 08 sub $0x8,%esp + 8048868: 68 cf a0 04 08 push $0x804a0cf + 804886d: 68 10 a1 04 08 push $0x804a110 + 8048872: e8 45 09 00 00 call 80491bc + 8048877: 83 c4 10 add $0x10,%esp + 804887a: b8 00 00 00 00 mov $0x0,%eax +} + 804887f: 8b 4d fc mov -0x4(%ebp),%ecx + 8048882: c9 leave + 8048883: 8d 61 fc lea -0x4(%ecx),%esp + 8048886: c3 ret + +08048887 : +#include + +#define QUAUX(X) #X +#define QU(X) QUAUX(X) + +void serial_print(char* str) { + 8048887: 55 push %ebp + 8048888: 89 e5 mov %esp,%ebp + 804888a: 53 push %ebx + asm volatile(" \ + 804888b: 8b 45 08 mov 0x8(%ebp),%eax + 804888e: 89 c3 mov %eax,%ebx + 8048890: b8 0b 00 00 00 mov $0xb,%eax + 8048895: cd 50 int $0x50 + mov $" QU(SYSCALL_SERIAL_PRINT) ", %%eax; \ + int $80; \ + "::"b"(str)); +} + 8048897: 90 nop + 8048898: 5b pop %ebx + 8048899: 5d pop %ebp + 804889a: c3 ret + +0804889b : +#include + +#define QUAUX(X) #X +#define QU(X) QUAUX(X) + +long initrd_sz() { + 804889b: 55 push %ebp + 804889c: 89 e5 mov %esp,%ebp + 804889e: 53 push %ebx + 804889f: 83 ec 10 sub $0x10,%esp + long size; + asm volatile(" \ + 80488a2: b8 0c 00 00 00 mov $0xc,%eax + 80488a7: cd 50 int $0x50 + 80488a9: 89 d8 mov %ebx,%eax + 80488ab: 89 45 f8 mov %eax,-0x8(%ebp) + mov $" QU(SYSCALL_GET_INITRD_SZ) ", %%eax; \ + int $80; \ + ":"=b"(size)); + return size; + 80488ae: 8b 45 f8 mov -0x8(%ebp),%eax +} + 80488b1: 83 c4 10 add $0x10,%esp + 80488b4: 5b pop %ebx + 80488b5: 5d pop %ebp + 80488b6: c3 ret + +080488b7 : + +void initrd_get(char* initrd) { + 80488b7: 55 push %ebp + 80488b8: 89 e5 mov %esp,%ebp + 80488ba: 53 push %ebx + asm volatile(" \ + 80488bb: 8b 45 08 mov 0x8(%ebp),%eax + 80488be: 89 c3 mov %eax,%ebx + 80488c0: b8 0d 00 00 00 mov $0xd,%eax + 80488c5: cd 50 int $0x50 + mov $" QU(SYSCALL_COPY_INITRD) ", %%eax; \ + int $80; \ + "::"b"(initrd)); +} + 80488c7: 90 nop + 80488c8: 5b pop %ebx + 80488c9: 5d pop %ebp + 80488ca: c3 ret + +080488cb : +#include + +#define QUAUX(X) #X +#define QU(X) QUAUX(X) + +void* alloc_memory(int num_pages) { + 80488cb: 55 push %ebp + 80488cc: 89 e5 mov %esp,%ebp + 80488ce: 53 push %ebx + 80488cf: 83 ec 10 sub $0x10,%esp + void* address; + asm volatile(" \ + 80488d2: 8b 45 08 mov 0x8(%ebp),%eax + 80488d5: ba 00 00 00 00 mov $0x0,%edx + 80488da: 89 c3 mov %eax,%ebx + 80488dc: 89 d1 mov %edx,%ecx + 80488de: b8 07 00 00 00 mov $0x7,%eax + 80488e3: cd 50 int $0x50 + 80488e5: 89 d8 mov %ebx,%eax + 80488e7: 89 45 f8 mov %eax,-0x8(%ebp) + mov $" QU(SYSCALL_ALLOC_MEM) ", %%eax; \ + int $80; \ + ":"=b"(address):"b"(num_pages),"c"(NULL)); + return address; + 80488ea: 8b 45 f8 mov -0x8(%ebp),%eax +} + 80488ed: 83 c4 10 add $0x10,%esp + 80488f0: 5b pop %ebx + 80488f1: 5d pop %ebp + 80488f2: c3 ret + +080488f3 : + +void alloc_memory_virt(int num_pages,void* addr) { + 80488f3: 55 push %ebp + 80488f4: 89 e5 mov %esp,%ebp + 80488f6: 53 push %ebx + asm volatile(" \ + 80488f7: 8b 45 08 mov 0x8(%ebp),%eax + 80488fa: 8b 55 0c mov 0xc(%ebp),%edx + 80488fd: 89 c3 mov %eax,%ebx + 80488ff: 89 d1 mov %edx,%ecx + 8048901: b8 07 00 00 00 mov $0x7,%eax + 8048906: cd 50 int $0x50 + mov $" QU(SYSCALL_ALLOC_MEM) ", %%eax; \ + int $80; \ + "::"b"(num_pages),"c"(addr)); +} + 8048908: 90 nop + 8048909: 5b pop %ebx + 804890a: 5d pop %ebp + 804890b: c3 ret + +0804890c : + +void* new_address_space() { + 804890c: 55 push %ebp + 804890d: 89 e5 mov %esp,%ebp + 804890f: 53 push %ebx + 8048910: 83 ec 10 sub $0x10,%esp + void* address_space; + asm volatile(" \ + 8048913: b8 09 00 00 00 mov $0x9,%eax + 8048918: cd 50 int $0x50 + 804891a: 89 d8 mov %ebx,%eax + 804891c: 89 45 f8 mov %eax,-0x8(%ebp) + mov $" QU(SYSCALL_NEW_ADDR_SPACE) ", %%eax; \ + int $80; \ + ":"=b"(address_space)); + return address_space; + 804891f: 8b 45 f8 mov -0x8(%ebp),%eax +} + 8048922: 83 c4 10 add $0x10,%esp + 8048925: 5b pop %ebx + 8048926: 5d pop %ebp + 8048927: c3 ret + +08048928 : + +void copy_data(void* address_space, void* data,size_t size,void* virt_addr) { + 8048928: 55 push %ebp + 8048929: 89 e5 mov %esp,%ebp + 804892b: 56 push %esi + 804892c: 53 push %ebx + asm volatile(" \ + 804892d: 8b 45 08 mov 0x8(%ebp),%eax + 8048930: 8b 4d 0c mov 0xc(%ebp),%ecx + 8048933: 8b 55 10 mov 0x10(%ebp),%edx + 8048936: 8b 75 14 mov 0x14(%ebp),%esi + 8048939: 89 c3 mov %eax,%ebx + 804893b: b8 0a 00 00 00 mov $0xa,%eax + 8048940: cd 50 int $0x50 + mov $" QU(SYSCALL_ADDR_SPACES_COPY_DATA) ", %%eax; \ + int $80; \ + "::"b"(address_space),"c"(data),"d"(size),"S"(virt_addr)); +} + 8048942: 90 nop + 8048943: 5b pop %ebx + 8048944: 5e pop %esi + 8048945: 5d pop %ebp + 8048946: c3 ret + +08048947 : + +void* put_data(void* address_space, void* data,size_t size) { + 8048947: 55 push %ebp + 8048948: 89 e5 mov %esp,%ebp + 804894a: 56 push %esi + 804894b: 53 push %ebx + 804894c: 83 ec 10 sub $0x10,%esp + void* virt_addr; + asm volatile(" \ + 804894f: 8b 45 08 mov 0x8(%ebp),%eax + 8048952: 8b 4d 0c mov 0xc(%ebp),%ecx + 8048955: 8b 55 10 mov 0x10(%ebp),%edx + 8048958: be 00 00 00 00 mov $0x0,%esi + 804895d: 89 c3 mov %eax,%ebx + 804895f: b8 0a 00 00 00 mov $0xa,%eax + 8048964: cd 50 int $0x50 + 8048966: 89 d8 mov %ebx,%eax + 8048968: 89 45 f4 mov %eax,-0xc(%ebp) + mov $" QU(SYSCALL_ADDR_SPACES_COPY_DATA) ", %%eax; \ + int $80; \ + ":"=b"(virt_addr):"b"(address_space),"c"(data),"d"(size),"S"(NULL)); + return virt_addr; + 804896b: 8b 45 f4 mov -0xc(%ebp),%eax +} + 804896e: 83 c4 10 add $0x10,%esp + 8048971: 5b pop %ebx + 8048972: 5e pop %esi + 8048973: 5d pop %ebp + 8048974: c3 ret + +08048975 : + +void* map_phys(void* phys_addr,size_t num_pages) { + 8048975: 55 push %ebp + 8048976: 89 e5 mov %esp,%ebp + 8048978: 53 push %ebx + 8048979: 83 ec 10 sub $0x10,%esp + void* virt_addr; + asm volatile(" \ + 804897c: 8b 45 08 mov 0x8(%ebp),%eax + 804897f: 8b 55 0c mov 0xc(%ebp),%edx + 8048982: 89 c3 mov %eax,%ebx + 8048984: 89 d1 mov %edx,%ecx + 8048986: b8 08 00 00 00 mov $0x8,%eax + 804898b: cd 50 int $0x50 + 804898d: 89 d8 mov %ebx,%eax + 804898f: 89 45 f8 mov %eax,-0x8(%ebp) + mov $" QU(SYSCALL_PRIV_MAP_PAGES) ", %%eax; \ + int $80; \ + ":"=b"(virt_addr):"b"(phys_addr),"c"(num_pages)); + return virt_addr; + 8048992: 8b 45 f8 mov -0x8(%ebp),%eax +} + 8048995: 83 c4 10 add $0x10,%esp + 8048998: 5b pop %ebx + 8048999: 5d pop %ebp + 804899a: c3 ret + +0804899b <__stdio_init>: + +/** + * Initialize stdio. + * Must not be called by user code. +*/ +void __stdio_init() { + 804899b: 55 push %ebp + 804899c: 89 e5 mov %esp,%ebp +} + 804899e: 90 nop + 804899f: 5d pop %ebp + 80489a0: c3 ret + +080489a1 : + +FILE* fopen(char* filename,char* mode) { + 80489a1: 55 push %ebp + 80489a2: 89 e5 mov %esp,%ebp + 80489a4: 83 ec 28 sub $0x28,%esp + serdes_state state={0}; + 80489a7: c7 45 dc 00 00 00 00 movl $0x0,-0x24(%ebp) + 80489ae: c7 45 e0 00 00 00 00 movl $0x0,-0x20(%ebp) + serialize_str(filename,&state); + 80489b5: 83 ec 0c sub $0xc,%esp + 80489b8: ff 75 08 pushl 0x8(%ebp) + 80489bb: e8 77 0e 00 00 call 8049837 + 80489c0: 83 c4 10 add $0x10,%esp + 80489c3: 40 inc %eax + 80489c4: 89 c2 mov %eax,%edx + 80489c6: 83 ec 08 sub $0x8,%esp + 80489c9: 8d 45 dc lea -0x24(%ebp),%eax + 80489cc: 50 push %eax + 80489cd: 52 push %edx + 80489ce: e8 83 13 00 00 call 8049d56 + 80489d3: 83 c4 10 add $0x10,%esp + 80489d6: 83 ec 0c sub $0xc,%esp + 80489d9: ff 75 08 pushl 0x8(%ebp) + 80489dc: e8 56 0e 00 00 call 8049837 + 80489e1: 83 c4 10 add $0x10,%esp + 80489e4: 8d 50 01 lea 0x1(%eax),%edx + 80489e7: 83 ec 04 sub $0x4,%esp + 80489ea: 8d 45 dc lea -0x24(%ebp),%eax + 80489ed: 50 push %eax + 80489ee: 52 push %edx + 80489ef: ff 75 08 pushl 0x8(%ebp) + 80489f2: e8 f3 13 00 00 call 8049dea + 80489f7: 83 c4 10 add $0x10,%esp + void* retval=rpc_call(2,"open",state.buf,state.sizeorpos); + 80489fa: 8b 55 e0 mov -0x20(%ebp),%edx + 80489fd: 8b 45 dc mov -0x24(%ebp),%eax + 8048a00: 52 push %edx + 8048a01: 50 push %eax + 8048a02: 68 34 a1 04 08 push $0x804a134 + 8048a07: 6a 02 push $0x2 + 8048a09: e8 a1 12 00 00 call 8049caf + 8048a0e: 83 c4 10 add $0x10,%esp + 8048a11: 89 45 f4 mov %eax,-0xc(%ebp) + free(state.buf); + 8048a14: 8b 45 dc mov -0x24(%ebp),%eax + 8048a17: 83 ec 0c sub $0xc,%esp + 8048a1a: 50 push %eax + 8048a1b: e8 b3 0c 00 00 call 80496d3 + 8048a20: 83 c4 10 add $0x10,%esp + start_deserialize(retval,&state); + 8048a23: 83 ec 08 sub $0x8,%esp + 8048a26: 8d 45 dc lea -0x24(%ebp),%eax + 8048a29: 50 push %eax + 8048a2a: ff 75 f4 pushl -0xc(%ebp) + 8048a2d: e8 13 14 00 00 call 8049e45 + 8048a32: 83 c4 10 add $0x10,%esp + int err=deserialize_int(&state); + 8048a35: 83 ec 0c sub $0xc,%esp + 8048a38: 8d 45 dc lea -0x24(%ebp),%eax + 8048a3b: 50 push %eax + 8048a3c: e8 1c 14 00 00 call 8049e5d + 8048a41: 83 c4 10 add $0x10,%esp + 8048a44: 89 45 f0 mov %eax,-0x10(%ebp) + void* fs_data=deserialize_ptr(&state); + 8048a47: 83 ec 0c sub $0xc,%esp + 8048a4a: 8d 45 dc lea -0x24(%ebp),%eax + 8048a4d: 50 push %eax + 8048a4e: e8 36 14 00 00 call 8049e89 + 8048a53: 83 c4 10 add $0x10,%esp + 8048a56: 89 45 ec mov %eax,-0x14(%ebp) + pid_t fs_pid=deserialize_int(&state); + 8048a59: 83 ec 0c sub $0xc,%esp + 8048a5c: 8d 45 dc lea -0x24(%ebp),%eax + 8048a5f: 50 push %eax + 8048a60: e8 f8 13 00 00 call 8049e5d + 8048a65: 83 c4 10 add $0x10,%esp + 8048a68: 89 45 e8 mov %eax,-0x18(%ebp) + rpc_deallocate_buf(retval,state.sizeorpos); + 8048a6b: 8b 45 e0 mov -0x20(%ebp),%eax + 8048a6e: 83 ec 08 sub $0x8,%esp + 8048a71: 50 push %eax + 8048a72: ff 75 f4 pushl -0xc(%ebp) + 8048a75: e8 7c 12 00 00 call 8049cf6 + 8048a7a: 83 c4 10 add $0x10,%esp + if (err) { + 8048a7d: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) + 8048a81: 74 07 je 8048a8a + return NULL; + 8048a83: b8 00 00 00 00 mov $0x0,%eax + 8048a88: eb 2e jmp 8048ab8 + } else { + FILE* file=malloc(sizeof(FILE)); + 8048a8a: 83 ec 0c sub $0xc,%esp + 8048a8d: 6a 0c push $0xc + 8048a8f: e8 e9 09 00 00 call 804947d + 8048a94: 83 c4 10 add $0x10,%esp + 8048a97: 89 45 e4 mov %eax,-0x1c(%ebp) + file->fs_pid=fs_pid; + 8048a9a: 8b 45 e4 mov -0x1c(%ebp),%eax + 8048a9d: 8b 55 e8 mov -0x18(%ebp),%edx + 8048aa0: 89 10 mov %edx,(%eax) + file->fs_data=fs_data; + 8048aa2: 8b 45 e4 mov -0x1c(%ebp),%eax + 8048aa5: 8b 55 ec mov -0x14(%ebp),%edx + 8048aa8: 89 50 04 mov %edx,0x4(%eax) + file->pos=0; + 8048aab: 8b 45 e4 mov -0x1c(%ebp),%eax + 8048aae: c7 40 08 00 00 00 00 movl $0x0,0x8(%eax) + return file; + 8048ab5: 8b 45 e4 mov -0x1c(%ebp),%eax + } +} + 8048ab8: c9 leave + 8048ab9: c3 ret + +08048aba : + * \param stream The stream to write to + * \returns the written character, or EOF on failure +*/ +int putc(int c, FILE* stream) __attribute__ ((alias ("fputc"))); + +int fputc(int c, FILE* stream) { + 8048aba: 55 push %ebp + 8048abb: 89 e5 mov %esp,%ebp + 8048abd: 83 ec 18 sub $0x18,%esp + char str[]={c,'\0'}; + 8048ac0: 8b 45 08 mov 0x8(%ebp),%eax + 8048ac3: 88 45 f6 mov %al,-0xa(%ebp) + 8048ac6: c6 45 f7 00 movb $0x0,-0x9(%ebp) + if (fputs(str,stream)==0) { + 8048aca: 83 ec 08 sub $0x8,%esp + 8048acd: ff 75 0c pushl 0xc(%ebp) + 8048ad0: 8d 45 f6 lea -0xa(%ebp),%eax + 8048ad3: 50 push %eax + 8048ad4: e8 25 02 00 00 call 8048cfe + 8048ad9: 83 c4 10 add $0x10,%esp + 8048adc: 85 c0 test %eax,%eax + 8048ade: 75 07 jne 8048ae7 + return EOF; + 8048ae0: b8 ff ff ff ff mov $0xffffffff,%eax + 8048ae5: eb 03 jmp 8048aea + } else { + return c; + 8048ae7: 8b 45 08 mov 0x8(%ebp),%eax + } + return EOF; +} + 8048aea: c9 leave + 8048aeb: c3 ret + +08048aec : + * \param stream The file to read from + * \returns the read character, or EOF if the read fails +*/ +int getc(FILE* stream) __attribute__ ((alias ("fgetc"))); + +int fgetc(FILE* stream) { + 8048aec: 55 push %ebp + 8048aed: 89 e5 mov %esp,%ebp + 8048aef: 83 ec 18 sub $0x18,%esp + char c[2]; + if (fgets(&c[0],1,stream)==NULL) { + 8048af2: 83 ec 04 sub $0x4,%esp + 8048af5: ff 75 08 pushl 0x8(%ebp) + 8048af8: 6a 01 push $0x1 + 8048afa: 8d 45 f6 lea -0xa(%ebp),%eax + 8048afd: 50 push %eax + 8048afe: e8 37 00 00 00 call 8048b3a + 8048b03: 83 c4 10 add $0x10,%esp + 8048b06: 85 c0 test %eax,%eax + 8048b08: 75 07 jne 8048b11 + return EOF; + 8048b0a: b8 ff ff ff ff mov $0xffffffff,%eax + 8048b0f: eb 06 jmp 8048b17 + } else { + return c[0]; + 8048b11: 8a 45 f6 mov -0xa(%ebp),%al + 8048b14: 0f be c0 movsbl %al,%eax + } + return EOF; +} + 8048b17: c9 leave + 8048b18: c3 ret + +08048b19 : + +char* gets(char* s) { + 8048b19: 55 push %ebp + 8048b1a: 89 e5 mov %esp,%ebp + 8048b1c: 83 ec 08 sub $0x8,%esp + return fgets(s,INT_MAX,stdin); + 8048b1f: a1 40 b0 04 08 mov 0x804b040,%eax + 8048b24: 83 ec 04 sub $0x4,%esp + 8048b27: 50 push %eax + 8048b28: 68 ff ff ff 7f push $0x7fffffff + 8048b2d: ff 75 08 pushl 0x8(%ebp) + 8048b30: e8 05 00 00 00 call 8048b3a + 8048b35: 83 c4 10 add $0x10,%esp +} + 8048b38: c9 leave + 8048b39: c3 ret + +08048b3a : + +char* fgets(char* str,int count,FILE* stream) { + 8048b3a: 55 push %ebp + 8048b3b: 89 e5 mov %esp,%ebp + 8048b3d: 83 ec 08 sub $0x8,%esp + fread(str,1,count,stream); + 8048b40: 8b 45 0c mov 0xc(%ebp),%eax + 8048b43: ff 75 10 pushl 0x10(%ebp) + 8048b46: 50 push %eax + 8048b47: 6a 01 push $0x1 + 8048b49: ff 75 08 pushl 0x8(%ebp) + 8048b4c: e8 08 00 00 00 call 8048b59 + 8048b51: 83 c4 10 add $0x10,%esp + return str; + 8048b54: 8b 45 08 mov 0x8(%ebp),%eax +} + 8048b57: c9 leave + 8048b58: c3 ret + +08048b59 : + +size_t fread(void* buffer_ptr,size_t size,size_t count,FILE* stream) { + 8048b59: 55 push %ebp + 8048b5a: 89 e5 mov %esp,%ebp + 8048b5c: 83 ec 28 sub $0x28,%esp + serdes_state state={0}; + 8048b5f: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) + 8048b66: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp) + serialize_ptr(stream->fs_data,&state); + 8048b6d: 8b 45 14 mov 0x14(%ebp),%eax + 8048b70: 8b 40 04 mov 0x4(%eax),%eax + 8048b73: 83 ec 08 sub $0x8,%esp + 8048b76: 8d 55 e4 lea -0x1c(%ebp),%edx + 8048b79: 52 push %edx + 8048b7a: 50 push %eax + 8048b7b: e8 20 12 00 00 call 8049da0 + 8048b80: 83 c4 10 add $0x10,%esp + serialize_int(size*count,&state); + 8048b83: 8b 45 0c mov 0xc(%ebp),%eax + 8048b86: 0f af 45 10 imul 0x10(%ebp),%eax + 8048b8a: 89 c2 mov %eax,%edx + 8048b8c: 83 ec 08 sub $0x8,%esp + 8048b8f: 8d 45 e4 lea -0x1c(%ebp),%eax + 8048b92: 50 push %eax + 8048b93: 52 push %edx + 8048b94: e8 bd 11 00 00 call 8049d56 + 8048b99: 83 c4 10 add $0x10,%esp + serialize_int(stream->pos,&state); + 8048b9c: 8b 45 14 mov 0x14(%ebp),%eax + 8048b9f: 8b 40 08 mov 0x8(%eax),%eax + 8048ba2: 83 ec 08 sub $0x8,%esp + 8048ba5: 8d 55 e4 lea -0x1c(%ebp),%edx + 8048ba8: 52 push %edx + 8048ba9: 50 push %eax + 8048baa: e8 a7 11 00 00 call 8049d56 + 8048baf: 83 c4 10 add $0x10,%esp + void* retbuf=rpc_call(stream->fs_pid,"read",state.buf,state.sizeorpos); + 8048bb2: 8b 4d e8 mov -0x18(%ebp),%ecx + 8048bb5: 8b 55 e4 mov -0x1c(%ebp),%edx + 8048bb8: 8b 45 14 mov 0x14(%ebp),%eax + 8048bbb: 8b 00 mov (%eax),%eax + 8048bbd: 51 push %ecx + 8048bbe: 52 push %edx + 8048bbf: 68 39 a1 04 08 push $0x804a139 + 8048bc4: 50 push %eax + 8048bc5: e8 e5 10 00 00 call 8049caf + 8048bca: 83 c4 10 add $0x10,%esp + 8048bcd: 89 45 f4 mov %eax,-0xc(%ebp) + free(state.buf); + 8048bd0: 8b 45 e4 mov -0x1c(%ebp),%eax + 8048bd3: 83 ec 0c sub $0xc,%esp + 8048bd6: 50 push %eax + 8048bd7: e8 f7 0a 00 00 call 80496d3 + 8048bdc: 83 c4 10 add $0x10,%esp + state.buf=NULL; + 8048bdf: c7 45 e4 00 00 00 00 movl $0x0,-0x1c(%ebp) + state.sizeorpos=0; + 8048be6: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp) + start_deserialize(retbuf,&state); + 8048bed: 83 ec 08 sub $0x8,%esp + 8048bf0: 8d 45 e4 lea -0x1c(%ebp),%eax + 8048bf3: 50 push %eax + 8048bf4: ff 75 f4 pushl -0xc(%ebp) + 8048bf7: e8 49 12 00 00 call 8049e45 + 8048bfc: 83 c4 10 add $0x10,%esp + int bytes_read=deserialize_int(&state); + 8048bff: 83 ec 0c sub $0xc,%esp + 8048c02: 8d 45 e4 lea -0x1c(%ebp),%eax + 8048c05: 50 push %eax + 8048c06: e8 52 12 00 00 call 8049e5d + 8048c0b: 83 c4 10 add $0x10,%esp + 8048c0e: 89 45 f0 mov %eax,-0x10(%ebp) + if (bytes_read) { + 8048c11: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) + 8048c15: 74 2f je 8048c46 + void* ary=deserialize_ary(bytes_read,&state); + 8048c17: 8b 45 f0 mov -0x10(%ebp),%eax + 8048c1a: 83 ec 08 sub $0x8,%esp + 8048c1d: 8d 55 e4 lea -0x1c(%ebp),%edx + 8048c20: 52 push %edx + 8048c21: 50 push %eax + 8048c22: e8 8e 12 00 00 call 8049eb5 + 8048c27: 83 c4 10 add $0x10,%esp + 8048c2a: 89 45 ec mov %eax,-0x14(%ebp) + memcpy(buffer_ptr,ary,size*count); + 8048c2d: 8b 45 0c mov 0xc(%ebp),%eax + 8048c30: 0f af 45 10 imul 0x10(%ebp),%eax + 8048c34: 83 ec 04 sub $0x4,%esp + 8048c37: 50 push %eax + 8048c38: ff 75 ec pushl -0x14(%ebp) + 8048c3b: ff 75 08 pushl 0x8(%ebp) + 8048c3e: e8 24 0b 00 00 call 8049767 + 8048c43: 83 c4 10 add $0x10,%esp + } + rpc_deallocate_buf(retbuf,state.sizeorpos); + 8048c46: 8b 45 e8 mov -0x18(%ebp),%eax + 8048c49: 83 ec 08 sub $0x8,%esp + 8048c4c: 50 push %eax + 8048c4d: ff 75 f4 pushl -0xc(%ebp) + 8048c50: e8 a1 10 00 00 call 8049cf6 + 8048c55: 83 c4 10 add $0x10,%esp + stream->pos+=bytes_read; + 8048c58: 8b 45 14 mov 0x14(%ebp),%eax + 8048c5b: 8b 50 08 mov 0x8(%eax),%edx + 8048c5e: 8b 45 f0 mov -0x10(%ebp),%eax + 8048c61: 01 c2 add %eax,%edx + 8048c63: 8b 45 14 mov 0x14(%ebp),%eax + 8048c66: 89 50 08 mov %edx,0x8(%eax) + return bytes_read; + 8048c69: 8b 45 f0 mov -0x10(%ebp),%eax +} + 8048c6c: c9 leave + 8048c6d: c3 ret + +08048c6e : + +int puts(const char *s) { + 8048c6e: 55 push %ebp + 8048c6f: 89 e5 mov %esp,%ebp + 8048c71: 83 ec 18 sub $0x18,%esp + char* str=malloc(sizeof(char)*(strlen(s)+2)); + 8048c74: 83 ec 0c sub $0xc,%esp + 8048c77: ff 75 08 pushl 0x8(%ebp) + 8048c7a: e8 b8 0b 00 00 call 8049837 + 8048c7f: 83 c4 10 add $0x10,%esp + 8048c82: 83 c0 02 add $0x2,%eax + 8048c85: 83 ec 0c sub $0xc,%esp + 8048c88: 50 push %eax + 8048c89: e8 ef 07 00 00 call 804947d + 8048c8e: 83 c4 10 add $0x10,%esp + 8048c91: 89 45 f4 mov %eax,-0xc(%ebp) + strcpy(str,s); + 8048c94: 83 ec 08 sub $0x8,%esp + 8048c97: ff 75 08 pushl 0x8(%ebp) + 8048c9a: ff 75 f4 pushl -0xc(%ebp) + 8048c9d: e8 ba 0b 00 00 call 804985c + 8048ca2: 83 c4 10 add $0x10,%esp + str[strlen(s)]='\n'; + 8048ca5: 83 ec 0c sub $0xc,%esp + 8048ca8: ff 75 08 pushl 0x8(%ebp) + 8048cab: e8 87 0b 00 00 call 8049837 + 8048cb0: 83 c4 10 add $0x10,%esp + 8048cb3: 8b 55 f4 mov -0xc(%ebp),%edx + 8048cb6: 01 d0 add %edx,%eax + 8048cb8: c6 00 0a movb $0xa,(%eax) + str[strlen(s)+1]='\0'; + 8048cbb: 83 ec 0c sub $0xc,%esp + 8048cbe: ff 75 08 pushl 0x8(%ebp) + 8048cc1: e8 71 0b 00 00 call 8049837 + 8048cc6: 83 c4 10 add $0x10,%esp + 8048cc9: 8d 50 01 lea 0x1(%eax),%edx + 8048ccc: 8b 45 f4 mov -0xc(%ebp),%eax + 8048ccf: 01 d0 add %edx,%eax + 8048cd1: c6 00 00 movb $0x0,(%eax) + int code=fputs(str,stdout); + 8048cd4: a1 44 b0 04 08 mov 0x804b044,%eax + 8048cd9: 83 ec 08 sub $0x8,%esp + 8048cdc: 50 push %eax + 8048cdd: ff 75 f4 pushl -0xc(%ebp) + 8048ce0: e8 19 00 00 00 call 8048cfe + 8048ce5: 83 c4 10 add $0x10,%esp + 8048ce8: 89 45 f0 mov %eax,-0x10(%ebp) + free(str); + 8048ceb: 83 ec 0c sub $0xc,%esp + 8048cee: ff 75 f4 pushl -0xc(%ebp) + 8048cf1: e8 dd 09 00 00 call 80496d3 + 8048cf6: 83 c4 10 add $0x10,%esp + return code; + 8048cf9: 8b 45 f0 mov -0x10(%ebp),%eax +} + 8048cfc: c9 leave + 8048cfd: c3 ret + +08048cfe : + +int fputs(const char* s, FILE* stream) { + 8048cfe: 55 push %ebp + 8048cff: 89 e5 mov %esp,%ebp + 8048d01: 83 ec 18 sub $0x18,%esp + size_t retval=fwrite((void*)s,strlen(s),1,stream); + 8048d04: 83 ec 0c sub $0xc,%esp + 8048d07: ff 75 08 pushl 0x8(%ebp) + 8048d0a: e8 28 0b 00 00 call 8049837 + 8048d0f: 83 c4 10 add $0x10,%esp + 8048d12: ff 75 0c pushl 0xc(%ebp) + 8048d15: 6a 01 push $0x1 + 8048d17: 50 push %eax + 8048d18: ff 75 08 pushl 0x8(%ebp) + 8048d1b: e8 1a 00 00 00 call 8048d3a + 8048d20: 83 c4 10 add $0x10,%esp + 8048d23: 89 45 f4 mov %eax,-0xc(%ebp) + if (retval==0) { + 8048d26: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) + 8048d2a: 75 07 jne 8048d33 + return 0; + 8048d2c: b8 00 00 00 00 mov $0x0,%eax + 8048d31: eb 05 jmp 8048d38 + } else { + return EOF; + 8048d33: b8 ff ff ff ff mov $0xffffffff,%eax + } +} + 8048d38: c9 leave + 8048d39: c3 ret + +08048d3a : + +size_t fwrite(void* buffer_ptr,size_t size,size_t count,FILE* stream) { + 8048d3a: 55 push %ebp + 8048d3b: 89 e5 mov %esp,%ebp + 8048d3d: 83 ec 18 sub $0x18,%esp + serdes_state state={0}; + 8048d40: c7 45 e8 00 00 00 00 movl $0x0,-0x18(%ebp) + 8048d47: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) + serialize_ptr(stream->fs_data,&state); + 8048d4e: 8b 45 14 mov 0x14(%ebp),%eax + 8048d51: 8b 40 04 mov 0x4(%eax),%eax + 8048d54: 83 ec 08 sub $0x8,%esp + 8048d57: 8d 55 e8 lea -0x18(%ebp),%edx + 8048d5a: 52 push %edx + 8048d5b: 50 push %eax + 8048d5c: e8 3f 10 00 00 call 8049da0 + 8048d61: 83 c4 10 add $0x10,%esp + serialize_int(size*count,&state); + 8048d64: 8b 45 0c mov 0xc(%ebp),%eax + 8048d67: 0f af 45 10 imul 0x10(%ebp),%eax + 8048d6b: 89 c2 mov %eax,%edx + 8048d6d: 83 ec 08 sub $0x8,%esp + 8048d70: 8d 45 e8 lea -0x18(%ebp),%eax + 8048d73: 50 push %eax + 8048d74: 52 push %edx + 8048d75: e8 dc 0f 00 00 call 8049d56 + 8048d7a: 83 c4 10 add $0x10,%esp + serialize_int(stream->pos,&state); + 8048d7d: 8b 45 14 mov 0x14(%ebp),%eax + 8048d80: 8b 40 08 mov 0x8(%eax),%eax + 8048d83: 83 ec 08 sub $0x8,%esp + 8048d86: 8d 55 e8 lea -0x18(%ebp),%edx + 8048d89: 52 push %edx + 8048d8a: 50 push %eax + 8048d8b: e8 c6 0f 00 00 call 8049d56 + 8048d90: 83 c4 10 add $0x10,%esp + serialize_ary(buffer_ptr,size*count,&state); + 8048d93: 8b 45 0c mov 0xc(%ebp),%eax + 8048d96: 0f af 45 10 imul 0x10(%ebp),%eax + 8048d9a: 83 ec 04 sub $0x4,%esp + 8048d9d: 8d 55 e8 lea -0x18(%ebp),%edx + 8048da0: 52 push %edx + 8048da1: 50 push %eax + 8048da2: ff 75 08 pushl 0x8(%ebp) + 8048da5: e8 40 10 00 00 call 8049dea + 8048daa: 83 c4 10 add $0x10,%esp + void* retbuf=rpc_call(stream->fs_pid,"write",state.buf,state.sizeorpos); + 8048dad: 8b 4d ec mov -0x14(%ebp),%ecx + 8048db0: 8b 55 e8 mov -0x18(%ebp),%edx + 8048db3: 8b 45 14 mov 0x14(%ebp),%eax + 8048db6: 8b 00 mov (%eax),%eax + 8048db8: 51 push %ecx + 8048db9: 52 push %edx + 8048dba: 68 3e a1 04 08 push $0x804a13e + 8048dbf: 50 push %eax + 8048dc0: e8 ea 0e 00 00 call 8049caf + 8048dc5: 83 c4 10 add $0x10,%esp + 8048dc8: 89 45 f4 mov %eax,-0xc(%ebp) + free(state.buf); + 8048dcb: 8b 45 e8 mov -0x18(%ebp),%eax + 8048dce: 83 ec 0c sub $0xc,%esp + 8048dd1: 50 push %eax + 8048dd2: e8 fc 08 00 00 call 80496d3 + 8048dd7: 83 c4 10 add $0x10,%esp + start_deserialize(retbuf,&state); + 8048dda: 83 ec 08 sub $0x8,%esp + 8048ddd: 8d 45 e8 lea -0x18(%ebp),%eax + 8048de0: 50 push %eax + 8048de1: ff 75 f4 pushl -0xc(%ebp) + 8048de4: e8 5c 10 00 00 call 8049e45 + 8048de9: 83 c4 10 add $0x10,%esp + int bytes_wrote=deserialize_int(&state); + 8048dec: 83 ec 0c sub $0xc,%esp + 8048def: 8d 45 e8 lea -0x18(%ebp),%eax + 8048df2: 50 push %eax + 8048df3: e8 65 10 00 00 call 8049e5d + 8048df8: 83 c4 10 add $0x10,%esp + 8048dfb: 89 45 f0 mov %eax,-0x10(%ebp) + rpc_deallocate_buf(retbuf,state.sizeorpos); + 8048dfe: 8b 45 ec mov -0x14(%ebp),%eax + 8048e01: 83 ec 08 sub $0x8,%esp + 8048e04: 50 push %eax + 8048e05: ff 75 f4 pushl -0xc(%ebp) + 8048e08: e8 e9 0e 00 00 call 8049cf6 + 8048e0d: 83 c4 10 add $0x10,%esp + stream->pos+=bytes_wrote; + 8048e10: 8b 45 14 mov 0x14(%ebp),%eax + 8048e13: 8b 50 08 mov 0x8(%eax),%edx + 8048e16: 8b 45 f0 mov -0x10(%ebp),%eax + 8048e19: 01 c2 add %eax,%edx + 8048e1b: 8b 45 14 mov 0x14(%ebp),%eax + 8048e1e: 89 50 08 mov %edx,0x8(%eax) + return bytes_wrote; + 8048e21: 8b 45 f0 mov -0x10(%ebp),%eax +} + 8048e24: c9 leave + 8048e25: c3 ret + +08048e26 : + +void register_fs(const char* name,pid_t pid) { + 8048e26: 55 push %ebp + 8048e27: 89 e5 mov %esp,%ebp + 8048e29: 83 ec 18 sub $0x18,%esp + serdes_state state={0}; + 8048e2c: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) + 8048e33: c7 45 f4 00 00 00 00 movl $0x0,-0xc(%ebp) + serial_print("libc register fs 1\n"); + 8048e3a: 83 ec 0c sub $0xc,%esp + 8048e3d: 68 44 a1 04 08 push $0x804a144 + 8048e42: e8 40 fa ff ff call 8048887 + 8048e47: 83 c4 10 add $0x10,%esp + serialize_str((char*)name,&state); + 8048e4a: 83 ec 0c sub $0xc,%esp + 8048e4d: ff 75 08 pushl 0x8(%ebp) + 8048e50: e8 e2 09 00 00 call 8049837 + 8048e55: 83 c4 10 add $0x10,%esp + 8048e58: 40 inc %eax + 8048e59: 89 c2 mov %eax,%edx + 8048e5b: 83 ec 08 sub $0x8,%esp + 8048e5e: 8d 45 f0 lea -0x10(%ebp),%eax + 8048e61: 50 push %eax + 8048e62: 52 push %edx + 8048e63: e8 ee 0e 00 00 call 8049d56 + 8048e68: 83 c4 10 add $0x10,%esp + 8048e6b: 83 ec 0c sub $0xc,%esp + 8048e6e: ff 75 08 pushl 0x8(%ebp) + 8048e71: e8 c1 09 00 00 call 8049837 + 8048e76: 83 c4 10 add $0x10,%esp + 8048e79: 8d 50 01 lea 0x1(%eax),%edx + 8048e7c: 83 ec 04 sub $0x4,%esp + 8048e7f: 8d 45 f0 lea -0x10(%ebp),%eax + 8048e82: 50 push %eax + 8048e83: 52 push %edx + 8048e84: ff 75 08 pushl 0x8(%ebp) + 8048e87: e8 5e 0f 00 00 call 8049dea + 8048e8c: 83 c4 10 add $0x10,%esp + serial_print("libc register fs 2\n"); + 8048e8f: 83 ec 0c sub $0xc,%esp + 8048e92: 68 58 a1 04 08 push $0x804a158 + 8048e97: e8 eb f9 ff ff call 8048887 + 8048e9c: 83 c4 10 add $0x10,%esp + serialize_int(pid,&state); + 8048e9f: 83 ec 08 sub $0x8,%esp + 8048ea2: 8d 45 f0 lea -0x10(%ebp),%eax + 8048ea5: 50 push %eax + 8048ea6: ff 75 0c pushl 0xc(%ebp) + 8048ea9: e8 a8 0e 00 00 call 8049d56 + 8048eae: 83 c4 10 add $0x10,%esp + serial_print("libc register fs 3\n"); + 8048eb1: 83 ec 0c sub $0xc,%esp + 8048eb4: 68 6c a1 04 08 push $0x804a16c + 8048eb9: e8 c9 f9 ff ff call 8048887 + 8048ebe: 83 c4 10 add $0x10,%esp + rpc_call(2,"register_fs",state.buf,state.sizeorpos); + 8048ec1: 8b 55 f4 mov -0xc(%ebp),%edx + 8048ec4: 8b 45 f0 mov -0x10(%ebp),%eax + 8048ec7: 52 push %edx + 8048ec8: 50 push %eax + 8048ec9: 68 80 a1 04 08 push $0x804a180 + 8048ece: 6a 02 push $0x2 + 8048ed0: e8 da 0d 00 00 call 8049caf + 8048ed5: 83 c4 10 add $0x10,%esp +} + 8048ed8: 90 nop + 8048ed9: c9 leave + 8048eda: c3 ret + +08048edb : + +int mount(char* file,char* type,char* path) { + 8048edb: 55 push %ebp + 8048edc: 89 e5 mov %esp,%ebp + 8048ede: 83 ec 18 sub $0x18,%esp + serdes_state state={0}; + 8048ee1: c7 45 ec 00 00 00 00 movl $0x0,-0x14(%ebp) + 8048ee8: c7 45 f0 00 00 00 00 movl $0x0,-0x10(%ebp) + serialize_str(type,&state); + 8048eef: 83 ec 0c sub $0xc,%esp + 8048ef2: ff 75 0c pushl 0xc(%ebp) + 8048ef5: e8 3d 09 00 00 call 8049837 + 8048efa: 83 c4 10 add $0x10,%esp + 8048efd: 40 inc %eax + 8048efe: 89 c2 mov %eax,%edx + 8048f00: 83 ec 08 sub $0x8,%esp + 8048f03: 8d 45 ec lea -0x14(%ebp),%eax + 8048f06: 50 push %eax + 8048f07: 52 push %edx + 8048f08: e8 49 0e 00 00 call 8049d56 + 8048f0d: 83 c4 10 add $0x10,%esp + 8048f10: 83 ec 0c sub $0xc,%esp + 8048f13: ff 75 0c pushl 0xc(%ebp) + 8048f16: e8 1c 09 00 00 call 8049837 + 8048f1b: 83 c4 10 add $0x10,%esp + 8048f1e: 8d 50 01 lea 0x1(%eax),%edx + 8048f21: 83 ec 04 sub $0x4,%esp + 8048f24: 8d 45 ec lea -0x14(%ebp),%eax + 8048f27: 50 push %eax + 8048f28: 52 push %edx + 8048f29: ff 75 0c pushl 0xc(%ebp) + 8048f2c: e8 b9 0e 00 00 call 8049dea + 8048f31: 83 c4 10 add $0x10,%esp + serialize_str(file,&state); + 8048f34: 83 ec 0c sub $0xc,%esp + 8048f37: ff 75 08 pushl 0x8(%ebp) + 8048f3a: e8 f8 08 00 00 call 8049837 + 8048f3f: 83 c4 10 add $0x10,%esp + 8048f42: 40 inc %eax + 8048f43: 89 c2 mov %eax,%edx + 8048f45: 83 ec 08 sub $0x8,%esp + 8048f48: 8d 45 ec lea -0x14(%ebp),%eax + 8048f4b: 50 push %eax + 8048f4c: 52 push %edx + 8048f4d: e8 04 0e 00 00 call 8049d56 + 8048f52: 83 c4 10 add $0x10,%esp + 8048f55: 83 ec 0c sub $0xc,%esp + 8048f58: ff 75 08 pushl 0x8(%ebp) + 8048f5b: e8 d7 08 00 00 call 8049837 + 8048f60: 83 c4 10 add $0x10,%esp + 8048f63: 8d 50 01 lea 0x1(%eax),%edx + 8048f66: 83 ec 04 sub $0x4,%esp + 8048f69: 8d 45 ec lea -0x14(%ebp),%eax + 8048f6c: 50 push %eax + 8048f6d: 52 push %edx + 8048f6e: ff 75 08 pushl 0x8(%ebp) + 8048f71: e8 74 0e 00 00 call 8049dea + 8048f76: 83 c4 10 add $0x10,%esp + serialize_str(path,&state); + 8048f79: 83 ec 0c sub $0xc,%esp + 8048f7c: ff 75 10 pushl 0x10(%ebp) + 8048f7f: e8 b3 08 00 00 call 8049837 + 8048f84: 83 c4 10 add $0x10,%esp + 8048f87: 40 inc %eax + 8048f88: 89 c2 mov %eax,%edx + 8048f8a: 83 ec 08 sub $0x8,%esp + 8048f8d: 8d 45 ec lea -0x14(%ebp),%eax + 8048f90: 50 push %eax + 8048f91: 52 push %edx + 8048f92: e8 bf 0d 00 00 call 8049d56 + 8048f97: 83 c4 10 add $0x10,%esp + 8048f9a: 83 ec 0c sub $0xc,%esp + 8048f9d: ff 75 10 pushl 0x10(%ebp) + 8048fa0: e8 92 08 00 00 call 8049837 + 8048fa5: 83 c4 10 add $0x10,%esp + 8048fa8: 8d 50 01 lea 0x1(%eax),%edx + 8048fab: 83 ec 04 sub $0x4,%esp + 8048fae: 8d 45 ec lea -0x14(%ebp),%eax + 8048fb1: 50 push %eax + 8048fb2: 52 push %edx + 8048fb3: ff 75 10 pushl 0x10(%ebp) + 8048fb6: e8 2f 0e 00 00 call 8049dea + 8048fbb: 83 c4 10 add $0x10,%esp + int* err=rpc_call(2,"mount",state.buf,state.sizeorpos); + 8048fbe: 8b 55 f0 mov -0x10(%ebp),%edx + 8048fc1: 8b 45 ec mov -0x14(%ebp),%eax + 8048fc4: 52 push %edx + 8048fc5: 50 push %eax + 8048fc6: 68 8c a1 04 08 push $0x804a18c + 8048fcb: 6a 02 push $0x2 + 8048fcd: e8 dd 0c 00 00 call 8049caf + 8048fd2: 83 c4 10 add $0x10,%esp + 8048fd5: 89 45 f4 mov %eax,-0xc(%ebp) + return *err; + 8048fd8: 8b 45 f4 mov -0xc(%ebp),%eax + 8048fdb: 8b 00 mov (%eax),%eax +} + 8048fdd: c9 leave + 8048fde: c3 ret + +08048fdf : + +int vfprintf(FILE* stream,const char* format,va_list arg) { + 8048fdf: 55 push %ebp + 8048fe0: 89 e5 mov %esp,%ebp + 8048fe2: 83 ec 38 sub $0x38,%esp + int c; + for(;*format!='\0';format++) { + 8048fe5: e9 7d 01 00 00 jmp 8049167 + if(*format!='%') { + 8048fea: 8b 45 0c mov 0xc(%ebp),%eax + 8048fed: 8a 00 mov (%eax),%al + 8048fef: 3c 25 cmp $0x25,%al + 8048ff1: 74 1f je 8049012 + c=fputc(*format,stream); + 8048ff3: 8b 45 0c mov 0xc(%ebp),%eax + 8048ff6: 8a 00 mov (%eax),%al + 8048ff8: 0f be c0 movsbl %al,%eax + 8048ffb: 83 ec 08 sub $0x8,%esp + 8048ffe: ff 75 08 pushl 0x8(%ebp) + 8049001: 50 push %eax + 8049002: e8 b3 fa ff ff call 8048aba + 8049007: 83 c4 10 add $0x10,%esp + 804900a: 89 45 ec mov %eax,-0x14(%ebp) + continue; + 804900d: e9 52 01 00 00 jmp 8049164 + } + format++; + 8049012: ff 45 0c incl 0xc(%ebp) + switch(*format) { + 8049015: 8b 45 0c mov 0xc(%ebp),%eax + 8049018: 8a 00 mov (%eax),%al + 804901a: 0f be c0 movsbl %al,%eax + 804901d: 83 f8 78 cmp $0x78,%eax + 8049020: 0f 84 f1 00 00 00 je 8049117 + 8049026: 83 f8 78 cmp $0x78,%eax + 8049029: 0f 8f 35 01 00 00 jg 8049164 + 804902f: 83 f8 73 cmp $0x73,%eax + 8049032: 0f 84 b0 00 00 00 je 80490e8 + 8049038: 83 f8 73 cmp $0x73,%eax + 804903b: 0f 8f 23 01 00 00 jg 8049164 + 8049041: 83 f8 63 cmp $0x63,%eax + 8049044: 74 0a je 8049050 + 8049046: 83 f8 64 cmp $0x64,%eax + 8049049: 74 3b je 8049086 + 804904b: e9 14 01 00 00 jmp 8049164 + case 'c': { + int i=va_arg(arg,int); + 8049050: 8b 45 10 mov 0x10(%ebp),%eax + 8049053: 8d 50 04 lea 0x4(%eax),%edx + 8049056: 89 55 10 mov %edx,0x10(%ebp) + 8049059: 8b 00 mov (%eax),%eax + 804905b: 89 45 e4 mov %eax,-0x1c(%ebp) + c=fputc(i,stream); + 804905e: 83 ec 08 sub $0x8,%esp + 8049061: ff 75 08 pushl 0x8(%ebp) + 8049064: ff 75 e4 pushl -0x1c(%ebp) + 8049067: e8 4e fa ff ff call 8048aba + 804906c: 83 c4 10 add $0x10,%esp + 804906f: 89 45 ec mov %eax,-0x14(%ebp) + if (c==EOF) { + 8049072: 83 7d ec ff cmpl $0xffffffff,-0x14(%ebp) + 8049076: 0f 85 e1 00 00 00 jne 804915d + return EOF; + 804907c: b8 ff ff ff ff mov $0xffffffff,%eax + 8049081: e9 f3 00 00 00 jmp 8049179 + } + break; + } + case 'd': { + int i=va_arg(arg,int); //Fetch Decimal/Integer argument + 8049086: 8b 45 10 mov 0x10(%ebp),%eax + 8049089: 8d 50 04 lea 0x4(%eax),%edx + 804908c: 89 55 10 mov %edx,0x10(%ebp) + 804908f: 8b 00 mov (%eax),%eax + 8049091: 89 45 f4 mov %eax,-0xc(%ebp) + if(i<0) { + 8049094: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) + 8049098: 79 13 jns 80490ad + i=-i; + 804909a: f7 5d f4 negl -0xc(%ebp) + fputc('-',stream); + 804909d: 83 ec 08 sub $0x8,%esp + 80490a0: ff 75 08 pushl 0x8(%ebp) + 80490a3: 6a 2d push $0x2d + 80490a5: e8 10 fa ff ff call 8048aba + 80490aa: 83 c4 10 add $0x10,%esp + } + char str[11]; + int_to_ascii(i,str); + 80490ad: 83 ec 08 sub $0x8,%esp + 80490b0: 8d 45 d9 lea -0x27(%ebp),%eax + 80490b3: 50 push %eax + 80490b4: ff 75 f4 pushl -0xc(%ebp) + 80490b7: e8 45 08 00 00 call 8049901 + 80490bc: 83 c4 10 add $0x10,%esp + c=fputs(str,stream); + 80490bf: 83 ec 08 sub $0x8,%esp + 80490c2: ff 75 08 pushl 0x8(%ebp) + 80490c5: 8d 45 d9 lea -0x27(%ebp),%eax + 80490c8: 50 push %eax + 80490c9: e8 30 fc ff ff call 8048cfe + 80490ce: 83 c4 10 add $0x10,%esp + 80490d1: 89 45 ec mov %eax,-0x14(%ebp) + if (c==EOF) { + 80490d4: 83 7d ec ff cmpl $0xffffffff,-0x14(%ebp) + 80490d8: 0f 85 82 00 00 00 jne 8049160 + return EOF; + 80490de: b8 ff ff ff ff mov $0xffffffff,%eax + 80490e3: e9 91 00 00 00 jmp 8049179 + // int i=va_arg(arg,unsigned int); //Fetch Octal representation + // puts(convert(i,8)); + // break; + // } + case 's': { + char* s=va_arg(arg,char*); + 80490e8: 8b 45 10 mov 0x10(%ebp),%eax + 80490eb: 8d 50 04 lea 0x4(%eax),%edx + 80490ee: 89 55 10 mov %edx,0x10(%ebp) + 80490f1: 8b 00 mov (%eax),%eax + 80490f3: 89 45 e8 mov %eax,-0x18(%ebp) + c=fputs(s,stream); + 80490f6: 83 ec 08 sub $0x8,%esp + 80490f9: ff 75 08 pushl 0x8(%ebp) + 80490fc: ff 75 e8 pushl -0x18(%ebp) + 80490ff: e8 fa fb ff ff call 8048cfe + 8049104: 83 c4 10 add $0x10,%esp + 8049107: 89 45 ec mov %eax,-0x14(%ebp) + if (c==EOF) { + 804910a: 83 7d ec ff cmpl $0xffffffff,-0x14(%ebp) + 804910e: 75 53 jne 8049163 + return EOF; + 8049110: b8 ff ff ff ff mov $0xffffffff,%eax + 8049115: eb 62 jmp 8049179 + } + break; + } + case 'x': { + unsigned int i=va_arg(arg, unsigned int); + 8049117: 8b 45 10 mov 0x10(%ebp),%eax + 804911a: 8d 50 04 lea 0x4(%eax),%edx + 804911d: 89 55 10 mov %edx,0x10(%ebp) + 8049120: 8b 00 mov (%eax),%eax + 8049122: 89 45 f0 mov %eax,-0x10(%ebp) + char str[11]; + str[0]='\0'; + 8049125: c6 45 ce 00 movb $0x0,-0x32(%ebp) + hex_to_ascii(i,str); + 8049129: 83 ec 08 sub $0x8,%esp + 804912c: 8d 45 ce lea -0x32(%ebp),%eax + 804912f: 50 push %eax + 8049130: ff 75 f0 pushl -0x10(%ebp) + 8049133: e8 5a 08 00 00 call 8049992 + 8049138: 83 c4 10 add $0x10,%esp + c=fputs(str,stream); + 804913b: 83 ec 08 sub $0x8,%esp + 804913e: ff 75 08 pushl 0x8(%ebp) + 8049141: 8d 45 ce lea -0x32(%ebp),%eax + 8049144: 50 push %eax + 8049145: e8 b4 fb ff ff call 8048cfe + 804914a: 83 c4 10 add $0x10,%esp + 804914d: 89 45 ec mov %eax,-0x14(%ebp) + if (c==EOF) { + 8049150: 83 7d ec ff cmpl $0xffffffff,-0x14(%ebp) + 8049154: 75 0e jne 8049164 + return EOF; + 8049156: b8 ff ff ff ff mov $0xffffffff,%eax + 804915b: eb 1c jmp 8049179 + break; + 804915d: 90 nop + 804915e: eb 04 jmp 8049164 + break; + 8049160: 90 nop + 8049161: eb 01 jmp 8049164 + break; + 8049163: 90 nop + for(;*format!='\0';format++) { + 8049164: ff 45 0c incl 0xc(%ebp) + 8049167: 8b 45 0c mov 0xc(%ebp),%eax + 804916a: 8a 00 mov (%eax),%al + 804916c: 84 c0 test %al,%al + 804916e: 0f 85 76 fe ff ff jne 8048fea + } + break; + } + } + } + return 1; + 8049174: b8 01 00 00 00 mov $0x1,%eax +} + 8049179: c9 leave + 804917a: c3 ret + +0804917b : + +int fprintf(FILE* stream,const char* format,...) { + 804917b: 55 push %ebp + 804917c: 89 e5 mov %esp,%ebp + 804917e: 83 ec 18 sub $0x18,%esp + va_list arg; + int code; + va_start(arg,format); + 8049181: 8d 45 10 lea 0x10(%ebp),%eax + 8049184: 89 45 f0 mov %eax,-0x10(%ebp) + code=vfprintf(stream,format,arg); + 8049187: 8b 45 f0 mov -0x10(%ebp),%eax + 804918a: 83 ec 04 sub $0x4,%esp + 804918d: 50 push %eax + 804918e: ff 75 0c pushl 0xc(%ebp) + 8049191: ff 75 08 pushl 0x8(%ebp) + 8049194: e8 46 fe ff ff call 8048fdf + 8049199: 83 c4 10 add $0x10,%esp + 804919c: 89 45 f4 mov %eax,-0xc(%ebp) + va_end(arg); + if (code) { + 804919f: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) + 80491a3: 74 10 je 80491b5 + return strlen(format); + 80491a5: 83 ec 0c sub $0xc,%esp + 80491a8: ff 75 0c pushl 0xc(%ebp) + 80491ab: e8 87 06 00 00 call 8049837 + 80491b0: 83 c4 10 add $0x10,%esp + 80491b3: eb 05 jmp 80491ba + } else { + return EOF; + 80491b5: b8 ff ff ff ff mov $0xffffffff,%eax + } +} + 80491ba: c9 leave + 80491bb: c3 ret + +080491bc : + +int printf(const char* format,...) { + 80491bc: 55 push %ebp + 80491bd: 89 e5 mov %esp,%ebp + 80491bf: 83 ec 18 sub $0x18,%esp + va_list arg; + int code; + va_start(arg,format); + 80491c2: 8d 45 0c lea 0xc(%ebp),%eax + 80491c5: 89 45 f0 mov %eax,-0x10(%ebp) + code=vfprintf(stdout,format,arg); + 80491c8: 8b 55 f0 mov -0x10(%ebp),%edx + 80491cb: a1 44 b0 04 08 mov 0x804b044,%eax + 80491d0: 83 ec 04 sub $0x4,%esp + 80491d3: 52 push %edx + 80491d4: ff 75 08 pushl 0x8(%ebp) + 80491d7: 50 push %eax + 80491d8: e8 02 fe ff ff call 8048fdf + 80491dd: 83 c4 10 add $0x10,%esp + 80491e0: 89 45 f4 mov %eax,-0xc(%ebp) + va_end(arg); + if (code) { + 80491e3: 83 7d f4 00 cmpl $0x0,-0xc(%ebp) + 80491e7: 74 10 je 80491f9 + return strlen(format); + 80491e9: 83 ec 0c sub $0xc,%esp + 80491ec: ff 75 08 pushl 0x8(%ebp) + 80491ef: e8 43 06 00 00 call 8049837 + 80491f4: 83 c4 10 add $0x10,%esp + 80491f7: eb 05 jmp 80491fe + } else { + return EOF; + 80491f9: b8 ff ff ff ff mov $0xffffffff,%eax + } +} + 80491fe: c9 leave + 80491ff: c3 ret + +08049200 : + +int fseek(FILE* stream,long offset,int origin) { + 8049200: 55 push %ebp + 8049201: 89 e5 mov %esp,%ebp + switch (origin) { + 8049203: 83 7d 10 03 cmpl $0x3,0x10(%ebp) + 8049207: 74 14 je 804921d + 8049209: 83 7d 10 03 cmpl $0x3,0x10(%ebp) + 804920d: 7f 2c jg 804923b + 804920f: 83 7d 10 01 cmpl $0x1,0x10(%ebp) + 8049213: 74 13 je 8049228 + 8049215: 83 7d 10 02 cmpl $0x2,0x10(%ebp) + 8049219: 74 23 je 804923e + stream->pos+=offset; + break; + case SEEK_END: + break; + default: + break; + 804921b: eb 1e jmp 804923b + stream->pos=offset; + 804921d: 8b 45 08 mov 0x8(%ebp),%eax + 8049220: 8b 55 0c mov 0xc(%ebp),%edx + 8049223: 89 50 08 mov %edx,0x8(%eax) + break; + 8049226: eb 17 jmp 804923f + stream->pos+=offset; + 8049228: 8b 45 08 mov 0x8(%ebp),%eax + 804922b: 8b 50 08 mov 0x8(%eax),%edx + 804922e: 8b 45 0c mov 0xc(%ebp),%eax + 8049231: 01 c2 add %eax,%edx + 8049233: 8b 45 08 mov 0x8(%ebp),%eax + 8049236: 89 50 08 mov %edx,0x8(%eax) + break; + 8049239: eb 04 jmp 804923f + break; + 804923b: 90 nop + 804923c: eb 01 jmp 804923f + break; + 804923e: 90 nop + } + return 0; + 804923f: b8 00 00 00 00 mov $0x0,%eax +} + 8049244: 5d pop %ebp + 8049245: c3 ret + +08049246 : + * Get a bit in a bitmap + * \param bmap The bitmap + * \param index The index in the bitmap + * \return the bit +*/ +static char get_bmap_bit(char* bmap,size_t index) { + 8049246: 55 push %ebp + 8049247: 89 e5 mov %esp,%ebp + 8049249: 53 push %ebx + 804924a: 83 ec 10 sub $0x10,%esp + size_t byte=index/8; + 804924d: 8b 45 0c mov 0xc(%ebp),%eax + 8049250: c1 e8 03 shr $0x3,%eax + 8049253: 89 45 f8 mov %eax,-0x8(%ebp) + size_t bit=index%8; + 8049256: 8b 45 0c mov 0xc(%ebp),%eax + 8049259: 83 e0 07 and $0x7,%eax + 804925c: 89 45 f4 mov %eax,-0xc(%ebp) + char entry=bmap[byte]; + 804925f: 8b 55 08 mov 0x8(%ebp),%edx + 8049262: 8b 45 f8 mov -0x8(%ebp),%eax + 8049265: 01 d0 add %edx,%eax + 8049267: 8a 00 mov (%eax),%al + 8049269: 88 45 f3 mov %al,-0xd(%ebp) + return (entry&(1<0; + 804926c: 0f be 55 f3 movsbl -0xd(%ebp),%edx + 8049270: 8b 45 f4 mov -0xc(%ebp),%eax + 8049273: bb 01 00 00 00 mov $0x1,%ebx + 8049278: 88 c1 mov %al,%cl + 804927a: d3 e3 shl %cl,%ebx + 804927c: 89 d8 mov %ebx,%eax + 804927e: 21 d0 and %edx,%eax + 8049280: 85 c0 test %eax,%eax + 8049282: 0f 9f c0 setg %al +} + 8049285: 83 c4 10 add $0x10,%esp + 8049288: 5b pop %ebx + 8049289: 5d pop %ebp + 804928a: c3 ret + +0804928b : +/** + * Set a bit in a bitmap + * \param bmap The bitmap + * \param index The index in the bitmap +*/ +static void set_bmap_bit(char* bmap,size_t index) { + 804928b: 55 push %ebp + 804928c: 89 e5 mov %esp,%ebp + 804928e: 53 push %ebx + 804928f: 83 ec 10 sub $0x10,%esp + size_t byte=index/8; + 8049292: 8b 45 0c mov 0xc(%ebp),%eax + 8049295: c1 e8 03 shr $0x3,%eax + 8049298: 89 45 f8 mov %eax,-0x8(%ebp) + size_t bit=index%8; + 804929b: 8b 45 0c mov 0xc(%ebp),%eax + 804929e: 83 e0 07 and $0x7,%eax + 80492a1: 89 45 f4 mov %eax,-0xc(%ebp) + bmap[byte]=bmap[byte]|(1<: +/** + * Clear a bit in a bitmap + * \param bmap The bitmap + * \param index The index in the bitmap +*/ +static void clear_bmap_bit(char* bmap,size_t index) { + 80492d1: 55 push %ebp + 80492d2: 89 e5 mov %esp,%ebp + 80492d4: 53 push %ebx + 80492d5: 83 ec 10 sub $0x10,%esp + size_t byte=index/8; + 80492d8: 8b 45 0c mov 0xc(%ebp),%eax + 80492db: c1 e8 03 shr $0x3,%eax + 80492de: 89 45 f8 mov %eax,-0x8(%ebp) + size_t bit=index%8; + 80492e1: 8b 45 0c mov 0xc(%ebp),%eax + 80492e4: 83 e0 07 and $0x7,%eax + 80492e7: 89 45 f4 mov %eax,-0xc(%ebp) + bmap[byte]=bmap[byte]&(~(1<: + +/** + * Add a block to the heap + * \param mem_blks The number of pages that this block will use +*/ +static void reserve_block(size_t mem_blks) { + 8049319: 55 push %ebp + 804931a: 89 e5 mov %esp,%ebp + 804931c: 53 push %ebx + 804931d: 83 ec 24 sub $0x24,%esp + size_t bmap_byts=((mem_blks*BLK_SZ)/4)/8; + 8049320: 8b 45 08 mov 0x8(%ebp),%eax + 8049323: c1 e0 0c shl $0xc,%eax + 8049326: c1 e8 05 shr $0x5,%eax + 8049329: 89 45 f0 mov %eax,-0x10(%ebp) + entries[num_used_entries].bitmap=alloc_memory((size_t)ceilf((double)bmap_byts/BLK_SZ)); + 804932c: 8b 45 f0 mov -0x10(%ebp),%eax + 804932f: ba 00 00 00 00 mov $0x0,%edx + 8049334: 89 45 d8 mov %eax,-0x28(%ebp) + 8049337: 89 55 dc mov %edx,-0x24(%ebp) + 804933a: df 6d d8 fildll -0x28(%ebp) + 804933d: dd 05 98 a1 04 08 fldl 0x804a198 + 8049343: de f9 fdivrp %st,%st(1) + 8049345: d9 5d d8 fstps -0x28(%ebp) + 8049348: 8b 45 d8 mov -0x28(%ebp),%eax + 804934b: 83 ec 0c sub $0xc,%esp + 804934e: 50 push %eax + 804934f: e8 b2 0b 00 00 call 8049f06 + 8049354: 83 c4 10 add $0x10,%esp + 8049357: d9 7d e6 fnstcw -0x1a(%ebp) + 804935a: 66 8b 45 e6 mov -0x1a(%ebp),%ax + 804935e: 80 cc 0c or $0xc,%ah + 8049361: 66 89 45 e4 mov %ax,-0x1c(%ebp) + 8049365: d9 6d e4 fldcw -0x1c(%ebp) + 8049368: df 7d d8 fistpll -0x28(%ebp) + 804936b: d9 6d e6 fldcw -0x1a(%ebp) + 804936e: 8b 45 d8 mov -0x28(%ebp),%eax + 8049371: 8b 1d 60 d8 04 08 mov 0x804d860,%ebx + 8049377: 83 ec 0c sub $0xc,%esp + 804937a: 50 push %eax + 804937b: e8 4b f5 ff ff call 80488cb + 8049380: 83 c4 10 add $0x10,%esp + 8049383: 89 c2 mov %eax,%edx + 8049385: 89 d8 mov %ebx,%eax + 8049387: c1 e0 02 shl $0x2,%eax + 804938a: 01 d8 add %ebx,%eax + 804938c: c1 e0 02 shl $0x2,%eax + 804938f: 05 60 b0 04 08 add $0x804b060,%eax + 8049394: 89 10 mov %edx,(%eax) + entries[num_used_entries].bitmap_byt_size=bmap_byts; + 8049396: 8b 15 60 d8 04 08 mov 0x804d860,%edx + 804939c: 89 d0 mov %edx,%eax + 804939e: c1 e0 02 shl $0x2,%eax + 80493a1: 01 d0 add %edx,%eax + 80493a3: c1 e0 02 shl $0x2,%eax + 80493a6: 8d 90 64 b0 04 08 lea 0x804b064(%eax),%edx + 80493ac: 8b 45 f0 mov -0x10(%ebp),%eax + 80493af: 89 02 mov %eax,(%edx) + entries[num_used_entries].bitmap_bit_size=bmap_byts*8; + 80493b1: 8b 15 60 d8 04 08 mov 0x804d860,%edx + 80493b7: 8b 45 f0 mov -0x10(%ebp),%eax + 80493ba: 8d 0c c5 00 00 00 00 lea 0x0(,%eax,8),%ecx + 80493c1: 89 d0 mov %edx,%eax + 80493c3: c1 e0 02 shl $0x2,%eax + 80493c6: 01 d0 add %edx,%eax + 80493c8: c1 e0 02 shl $0x2,%eax + 80493cb: 05 68 b0 04 08 add $0x804b068,%eax + 80493d0: 89 08 mov %ecx,(%eax) + char* bmap=entries[num_used_entries].bitmap; + 80493d2: 8b 15 60 d8 04 08 mov 0x804d860,%edx + 80493d8: 89 d0 mov %edx,%eax + 80493da: c1 e0 02 shl $0x2,%eax + 80493dd: 01 d0 add %edx,%eax + 80493df: c1 e0 02 shl $0x2,%eax + 80493e2: 05 60 b0 04 08 add $0x804b060,%eax + 80493e7: 8b 00 mov (%eax),%eax + 80493e9: 89 45 ec mov %eax,-0x14(%ebp) + size_t bmap_byt_sz=entries[num_used_entries].bitmap_byt_size; + 80493ec: 8b 15 60 d8 04 08 mov 0x804d860,%edx + 80493f2: 89 d0 mov %edx,%eax + 80493f4: c1 e0 02 shl $0x2,%eax + 80493f7: 01 d0 add %edx,%eax + 80493f9: c1 e0 02 shl $0x2,%eax + 80493fc: 05 64 b0 04 08 add $0x804b064,%eax + 8049401: 8b 00 mov (%eax),%eax + 8049403: 89 45 e8 mov %eax,-0x18(%ebp) + for(size_t i=0;i + bmap[i]=0; + 804940f: 8b 55 ec mov -0x14(%ebp),%edx + 8049412: 8b 45 f4 mov -0xc(%ebp),%eax + 8049415: 01 d0 add %edx,%eax + 8049417: c6 00 00 movb $0x0,(%eax) + for(size_t i=0;i + } + entries[num_used_entries].avail_data_size=mem_blks*BLK_SZ; + 8049425: 8b 15 60 d8 04 08 mov 0x804d860,%edx + 804942b: 8b 45 08 mov 0x8(%ebp),%eax + 804942e: c1 e0 0c shl $0xc,%eax + 8049431: 89 c1 mov %eax,%ecx + 8049433: 89 d0 mov %edx,%eax + 8049435: c1 e0 02 shl $0x2,%eax + 8049438: 01 d0 add %edx,%eax + 804943a: c1 e0 02 shl $0x2,%eax + 804943d: 05 6c b0 04 08 add $0x804b06c,%eax + 8049442: 89 08 mov %ecx,(%eax) + entries[num_used_entries].data_block=alloc_memory(mem_blks); + 8049444: 8b 45 08 mov 0x8(%ebp),%eax + 8049447: 8b 1d 60 d8 04 08 mov 0x804d860,%ebx + 804944d: 83 ec 0c sub $0xc,%esp + 8049450: 50 push %eax + 8049451: e8 75 f4 ff ff call 80488cb + 8049456: 83 c4 10 add $0x10,%esp + 8049459: 89 c2 mov %eax,%edx + 804945b: 89 d8 mov %ebx,%eax + 804945d: c1 e0 02 shl $0x2,%eax + 8049460: 01 d8 add %ebx,%eax + 8049462: c1 e0 02 shl $0x2,%eax + 8049465: 05 70 b0 04 08 add $0x804b070,%eax + 804946a: 89 10 mov %edx,(%eax) + num_used_entries++; + 804946c: a1 60 d8 04 08 mov 0x804d860,%eax + 8049471: 40 inc %eax + 8049472: a3 60 d8 04 08 mov %eax,0x804d860 +} + 8049477: 90 nop + 8049478: 8b 5d fc mov -0x4(%ebp),%ebx + 804947b: c9 leave + 804947c: c3 ret + +0804947d : + +void* malloc(size_t size) { + 804947d: 55 push %ebp + 804947e: 89 e5 mov %esp,%ebp + 8049480: 57 push %edi + 8049481: 56 push %esi + 8049482: 53 push %ebx + 8049483: 83 ec 6c sub $0x6c,%esp + size_t num_4b_grps=(size_t)ceilf((float)size/4); + 8049486: 8b 45 08 mov 0x8(%ebp),%eax + 8049489: ba 00 00 00 00 mov $0x0,%edx + 804948e: 89 45 88 mov %eax,-0x78(%ebp) + 8049491: 89 55 8c mov %edx,-0x74(%ebp) + 8049494: df 6d 88 fildll -0x78(%ebp) + 8049497: d9 05 a0 a1 04 08 flds 0x804a1a0 + 804949d: de f9 fdivrp %st,%st(1) + 804949f: 83 ec 0c sub $0xc,%esp + 80494a2: 8d 64 24 fc lea -0x4(%esp),%esp + 80494a6: d9 1c 24 fstps (%esp) + 80494a9: e8 58 0a 00 00 call 8049f06 + 80494ae: 83 c4 10 add $0x10,%esp + 80494b1: d9 7d 96 fnstcw -0x6a(%ebp) + 80494b4: 66 8b 45 96 mov -0x6a(%ebp),%ax + 80494b8: 80 cc 0c or $0xc,%ah + 80494bb: 66 89 45 94 mov %ax,-0x6c(%ebp) + 80494bf: d9 6d 94 fldcw -0x6c(%ebp) + 80494c2: df 7d 88 fistpll -0x78(%ebp) + 80494c5: d9 6d 96 fldcw -0x6a(%ebp) + 80494c8: 8b 45 88 mov -0x78(%ebp),%eax + 80494cb: 89 45 c0 mov %eax,-0x40(%ebp) + num_4b_grps+=3; + 80494ce: 83 45 c0 03 addl $0x3,-0x40(%ebp) + int blk_indx=-1; + 80494d2: c7 45 e4 ff ff ff ff movl $0xffffffff,-0x1c(%ebp) + size_t bmap_index; + heap_block entry; + for (size_t i=0;i + size_t remaining_blks; + entry=entries[i]; + 80494e5: 8b 55 dc mov -0x24(%ebp),%edx + 80494e8: 89 d0 mov %edx,%eax + 80494ea: c1 e0 02 shl $0x2,%eax + 80494ed: 01 d0 add %edx,%eax + 80494ef: c1 e0 02 shl $0x2,%eax + 80494f2: 8d 90 60 b0 04 08 lea 0x804b060(%eax),%edx + 80494f8: 8d 45 98 lea -0x68(%ebp),%eax + 80494fb: 89 d3 mov %edx,%ebx + 80494fd: ba 05 00 00 00 mov $0x5,%edx + 8049502: 89 c7 mov %eax,%edi + 8049504: 89 de mov %ebx,%esi + 8049506: 89 d1 mov %edx,%ecx + 8049508: f3 a5 rep movsl %ds:(%esi),%es:(%edi) + if (entry.avail_data_size>=size) { + 804950a: 8b 45 a4 mov -0x5c(%ebp),%eax + 804950d: 39 45 08 cmp %eax,0x8(%ebp) + 8049510: 0f 87 aa 00 00 00 ja 80495c0 + char* bmap=entry.bitmap; + 8049516: 8b 45 98 mov -0x68(%ebp),%eax + 8049519: 89 45 bc mov %eax,-0x44(%ebp) + size_t bmap_byt_sz=entry.bitmap_byt_size; + 804951c: 8b 45 9c mov -0x64(%ebp),%eax + 804951f: 89 45 b8 mov %eax,-0x48(%ebp) + for(size_t i=0;i + char got_0=0; + 804952e: c6 45 d3 00 movb $0x0,-0x2d(%ebp) + remaining_blks=num_4b_grps; + 8049532: 8b 45 c0 mov -0x40(%ebp),%eax + 8049535: 89 45 d8 mov %eax,-0x28(%ebp) + size_t old_j; + for (size_t j=i*8;;j++) { + 8049538: 8b 45 d4 mov -0x2c(%ebp),%eax + 804953b: c1 e0 03 shl $0x3,%eax + 804953e: 89 45 c8 mov %eax,-0x38(%ebp) + char bit=get_bmap_bit(bmap,j); + 8049541: 83 ec 08 sub $0x8,%esp + 8049544: ff 75 c8 pushl -0x38(%ebp) + 8049547: ff 75 bc pushl -0x44(%ebp) + 804954a: e8 f7 fc ff ff call 8049246 + 804954f: 83 c4 10 add $0x10,%esp + 8049552: 88 45 b7 mov %al,-0x49(%ebp) + if (got_0) { + 8049555: 80 7d d3 00 cmpb $0x0,-0x2d(%ebp) + 8049559: 74 27 je 8049582 + if (bit) { + 804955b: 80 7d b7 00 cmpb $0x0,-0x49(%ebp) + 804955f: 74 1c je 804957d + if (remaining_blks==0) { + 8049561: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) + 8049565: 75 08 jne 804956f + bmap_index=old_j; + 8049567: 8b 45 cc mov -0x34(%ebp),%eax + 804956a: 89 45 e0 mov %eax,-0x20(%ebp) + break; + 804956d: eb 39 jmp 80495a8 + } else { + i+=j/8; + 804956f: 8b 45 c8 mov -0x38(%ebp),%eax + 8049572: c1 e8 03 shr $0x3,%eax + 8049575: 01 45 d4 add %eax,-0x2c(%ebp) + i--; + 8049578: ff 4d d4 decl -0x2c(%ebp) + break; + 804957b: eb 2b jmp 80495a8 + } + } else { + remaining_blks--; + 804957d: ff 4d d8 decl -0x28(%ebp) + 8049580: eb 13 jmp 8049595 + } + } else { + if (!bit) { + 8049582: 80 7d b7 00 cmpb $0x0,-0x49(%ebp) + 8049586: 75 0d jne 8049595 + got_0=1; + 8049588: c6 45 d3 01 movb $0x1,-0x2d(%ebp) + old_j=j; + 804958c: 8b 45 c8 mov -0x38(%ebp),%eax + 804958f: 89 45 cc mov %eax,-0x34(%ebp) + remaining_blks--; + 8049592: ff 4d d8 decl -0x28(%ebp) + } + } + if (remaining_blks==0) { + 8049595: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) + 8049599: 75 08 jne 80495a3 + bmap_index=old_j; + 804959b: 8b 45 cc mov -0x34(%ebp),%eax + 804959e: 89 45 e0 mov %eax,-0x20(%ebp) + break; + 80495a1: eb 05 jmp 80495a8 + for (size_t j=i*8;;j++) { + 80495a3: ff 45 c8 incl -0x38(%ebp) + 80495a6: eb 99 jmp 8049541 + } + } + if (remaining_blks==0) { + 80495a8: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) + 80495ac: 74 11 je 80495bf + for(size_t i=0;i + 80495bd: eb 01 jmp 80495c0 + break; + 80495bf: 90 nop + } + } + } + if (remaining_blks==0) { + 80495c0: 83 7d d8 00 cmpl $0x0,-0x28(%ebp) + 80495c4: 75 08 jne 80495ce + blk_indx=i; + 80495c6: 8b 45 dc mov -0x24(%ebp),%eax + 80495c9: 89 45 e4 mov %eax,-0x1c(%ebp) + break; + 80495cc: eb 11 jmp 80495df + for (size_t i=0;i + } + } + if (blk_indx==-1) { + 80495df: 83 7d e4 ff cmpl $0xffffffff,-0x1c(%ebp) + 80495e3: 75 20 jne 8049605 + // reserve_block((size_t)ceilf((double)size/BLK_SZ)); + reserve_block(1024); + 80495e5: 83 ec 0c sub $0xc,%esp + 80495e8: 68 00 04 00 00 push $0x400 + 80495ed: e8 27 fd ff ff call 8049319 + 80495f2: 83 c4 10 add $0x10,%esp + return malloc(size); + 80495f5: 83 ec 0c sub $0xc,%esp + 80495f8: ff 75 08 pushl 0x8(%ebp) + 80495fb: e8 7d fe ff ff call 804947d + 8049600: 83 c4 10 add $0x10,%esp + 8049603: eb 78 jmp 804967d + } + for (size_t i=0;i + set_bmap_bit(entry.bitmap,bmap_index+i); + 804960e: 8b 55 e0 mov -0x20(%ebp),%edx + 8049611: 8b 45 c4 mov -0x3c(%ebp),%eax + 8049614: 01 c2 add %eax,%edx + 8049616: 8b 45 98 mov -0x68(%ebp),%eax + 8049619: 83 ec 08 sub $0x8,%esp + 804961c: 52 push %edx + 804961d: 50 push %eax + 804961e: e8 68 fc ff ff call 804928b + 8049623: 83 c4 10 add $0x10,%esp + for (size_t i=0;i + } + size_t data_offset=(bmap_index*8)+12; + 8049631: 8b 45 e0 mov -0x20(%ebp),%eax + 8049634: c1 e0 03 shl $0x3,%eax + 8049637: 83 c0 0c add $0xc,%eax + 804963a: 89 45 b0 mov %eax,-0x50(%ebp) + size_t* info=(void*)(((char*)entry.data_block)+data_offset-12); + 804963d: 8b 45 a8 mov -0x58(%ebp),%eax + 8049640: 8b 55 b0 mov -0x50(%ebp),%edx + 8049643: 83 ea 0c sub $0xc,%edx + 8049646: 01 d0 add %edx,%eax + 8049648: 89 45 ac mov %eax,-0x54(%ebp) + info[0]=num_4b_grps; + 804964b: 8b 45 ac mov -0x54(%ebp),%eax + 804964e: 8b 55 c0 mov -0x40(%ebp),%edx + 8049651: 89 10 mov %edx,(%eax) + info[1]=bmap_index; + 8049653: 8b 45 ac mov -0x54(%ebp),%eax + 8049656: 8d 50 04 lea 0x4(%eax),%edx + 8049659: 8b 45 e0 mov -0x20(%ebp),%eax + 804965c: 89 02 mov %eax,(%edx) + info[2]=blk_indx; + 804965e: 8b 45 ac mov -0x54(%ebp),%eax + 8049661: 8d 50 08 lea 0x8(%eax),%edx + 8049664: 8b 45 e4 mov -0x1c(%ebp),%eax + 8049667: 89 02 mov %eax,(%edx) + entry.avail_data_size-=size+12; + 8049669: 8b 45 a4 mov -0x5c(%ebp),%eax + 804966c: 2b 45 08 sub 0x8(%ebp),%eax + 804966f: 83 e8 0c sub $0xc,%eax + 8049672: 89 45 a4 mov %eax,-0x5c(%ebp) + return (void*)(((char*)entry.data_block)+data_offset); + 8049675: 8b 55 a8 mov -0x58(%ebp),%edx + 8049678: 8b 45 b0 mov -0x50(%ebp),%eax + 804967b: 01 d0 add %edx,%eax + +} + 804967d: 8d 65 f4 lea -0xc(%ebp),%esp + 8049680: 5b pop %ebx + 8049681: 5e pop %esi + 8049682: 5f pop %edi + 8049683: 5d pop %ebp + 8049684: c3 ret + +08049685 : + +void* realloc(void *mem, size_t new_sz) { + 8049685: 55 push %ebp + 8049686: 89 e5 mov %esp,%ebp + 8049688: 83 ec 18 sub $0x18,%esp + void* ptr=malloc(new_sz); + 804968b: 83 ec 0c sub $0xc,%esp + 804968e: ff 75 0c pushl 0xc(%ebp) + 8049691: e8 e7 fd ff ff call 804947d + 8049696: 83 c4 10 add $0x10,%esp + 8049699: 89 45 f4 mov %eax,-0xc(%ebp) + if (mem==NULL) { + 804969c: 83 7d 08 00 cmpl $0x0,0x8(%ebp) + 80496a0: 75 05 jne 80496a7 + return ptr; + 80496a2: 8b 45 f4 mov -0xc(%ebp),%eax + 80496a5: eb 2a jmp 80496d1 + } + size_t num_4b_grps=*((size_t*)((char*)mem-12)); + 80496a7: 8b 45 08 mov 0x8(%ebp),%eax + 80496aa: 8b 40 f4 mov -0xc(%eax),%eax + 80496ad: 89 45 f0 mov %eax,-0x10(%ebp) + memcpy(ptr,mem,num_4b_grps*4); + 80496b0: 8b 45 f0 mov -0x10(%ebp),%eax + 80496b3: c1 e0 02 shl $0x2,%eax + 80496b6: 83 ec 04 sub $0x4,%esp + 80496b9: 50 push %eax + 80496ba: ff 75 08 pushl 0x8(%ebp) + 80496bd: ff 75 f4 pushl -0xc(%ebp) + 80496c0: e8 a2 00 00 00 call 8049767 + 80496c5: 83 c4 10 add $0x10,%esp + //free(mem); + mem=ptr; + 80496c8: 8b 45 f4 mov -0xc(%ebp),%eax + 80496cb: 89 45 08 mov %eax,0x8(%ebp) + return ptr; + 80496ce: 8b 45 f4 mov -0xc(%ebp),%eax +} + 80496d1: c9 leave + 80496d2: c3 ret + +080496d3 : + +void free(void* mem) { + 80496d3: 55 push %ebp + 80496d4: 89 e5 mov %esp,%ebp + 80496d6: 57 push %edi + 80496d7: 56 push %esi + 80496d8: 53 push %ebx + 80496d9: 83 ec 30 sub $0x30,%esp + size_t* info=(size_t*)((char*)mem-12); + 80496dc: 8b 45 08 mov 0x8(%ebp),%eax + 80496df: 83 e8 0c sub $0xc,%eax + 80496e2: 89 45 ec mov %eax,-0x14(%ebp) + size_t num_4b_grps=info[0]; + 80496e5: 8b 45 ec mov -0x14(%ebp),%eax + 80496e8: 8b 00 mov (%eax),%eax + 80496ea: 89 45 e8 mov %eax,-0x18(%ebp) + size_t bmap_index=info[1]; + 80496ed: 8b 45 ec mov -0x14(%ebp),%eax + 80496f0: 8b 40 04 mov 0x4(%eax),%eax + 80496f3: 89 45 e4 mov %eax,-0x1c(%ebp) + size_t blk_indx=info[2]; + 80496f6: 8b 45 ec mov -0x14(%ebp),%eax + 80496f9: 8b 40 08 mov 0x8(%eax),%eax + 80496fc: 89 45 e0 mov %eax,-0x20(%ebp) + heap_block entry=entries[blk_indx]; + 80496ff: 8b 55 e0 mov -0x20(%ebp),%edx + 8049702: 89 d0 mov %edx,%eax + 8049704: c1 e0 02 shl $0x2,%eax + 8049707: 01 d0 add %edx,%eax + 8049709: c1 e0 02 shl $0x2,%eax + 804970c: 8d 90 60 b0 04 08 lea 0x804b060(%eax),%edx + 8049712: 8d 45 cc lea -0x34(%ebp),%eax + 8049715: 89 d3 mov %edx,%ebx + 8049717: ba 05 00 00 00 mov $0x5,%edx + 804971c: 89 c7 mov %eax,%edi + 804971e: 89 de mov %ebx,%esi + 8049720: 89 d1 mov %edx,%ecx + 8049722: f3 a5 rep movsl %ds:(%esi),%es:(%edi) + for (size_t i=0;i + clear_bmap_bit(entry.bitmap,bmap_index+i); + 804972d: 8b 55 e4 mov -0x1c(%ebp),%edx + 8049730: 8b 45 f0 mov -0x10(%ebp),%eax + 8049733: 01 c2 add %eax,%edx + 8049735: 8b 45 cc mov -0x34(%ebp),%eax + 8049738: 52 push %edx + 8049739: 50 push %eax + 804973a: e8 92 fb ff ff call 80492d1 + 804973f: 83 c4 08 add $0x8,%esp + for (size_t i=0;i + } + entry.avail_data_size+=(num_4b_grps*4)+12; + 804974d: 8b 45 d8 mov -0x28(%ebp),%eax + 8049750: 8b 55 e8 mov -0x18(%ebp),%edx + 8049753: 83 c2 03 add $0x3,%edx + 8049756: c1 e2 02 shl $0x2,%edx + 8049759: 01 d0 add %edx,%eax + 804975b: 89 45 d8 mov %eax,-0x28(%ebp) +} + 804975e: 90 nop + 804975f: 8d 65 f4 lea -0xc(%ebp),%esp + 8049762: 5b pop %ebx + 8049763: 5e pop %esi + 8049764: 5f pop %edi + 8049765: 5d pop %ebp + 8049766: c3 ret + +08049767 : +#include +#include +#include +#include + +void* memcpy(void* dest_ptr,const void* source_ptr,size_t len) { + 8049767: 55 push %ebp + 8049768: 89 e5 mov %esp,%ebp + 804976a: 83 ec 10 sub $0x10,%esp + char* source=(char*)source_ptr; + 804976d: 8b 45 0c mov 0xc(%ebp),%eax + 8049770: 89 45 f8 mov %eax,-0x8(%ebp) + char* dest=(char*)dest_ptr; + 8049773: 8b 45 08 mov 0x8(%ebp),%eax + 8049776: 89 45 f4 mov %eax,-0xc(%ebp) + for(size_t i=0;i + dest[i]=source[i]; + 8049782: 8b 55 f8 mov -0x8(%ebp),%edx + 8049785: 8b 45 fc mov -0x4(%ebp),%eax + 8049788: 01 d0 add %edx,%eax + 804978a: 8b 4d f4 mov -0xc(%ebp),%ecx + 804978d: 8b 55 fc mov -0x4(%ebp),%edx + 8049790: 01 ca add %ecx,%edx + 8049792: 8a 00 mov (%eax),%al + 8049794: 88 02 mov %al,(%edx) + for(size_t i=0;i + } + return dest_ptr; + 80497a1: 8b 45 08 mov 0x8(%ebp),%eax +} + 80497a4: c9 leave + 80497a5: c3 ret + +080497a6 : + +void* memset(void *dest_ptr,int val,size_t len) { + 80497a6: 55 push %ebp + 80497a7: 89 e5 mov %esp,%ebp + 80497a9: 83 ec 10 sub $0x10,%esp + char* dest=(char*)dest_ptr; + 80497ac: 8b 45 08 mov 0x8(%ebp),%eax + 80497af: 89 45 f8 mov %eax,-0x8(%ebp) + for (size_t i=0;i + dest[i]=(char)val; + 80497bb: 8b 55 f8 mov -0x8(%ebp),%edx + 80497be: 8b 45 fc mov -0x4(%ebp),%eax + 80497c1: 01 d0 add %edx,%eax + 80497c3: 8b 55 0c mov 0xc(%ebp),%edx + 80497c6: 88 10 mov %dl,(%eax) + for (size_t i=0;i + } + return dest_ptr; + 80497d3: 8b 45 08 mov 0x8(%ebp),%eax +} + 80497d6: c9 leave + 80497d7: c3 ret + +080497d8 : + +int strcmp(const char* s1,const char* s2) { + 80497d8: 55 push %ebp + 80497d9: 89 e5 mov %esp,%ebp + 80497db: 83 ec 10 sub $0x10,%esp + int i; + for (i = 0; s1[i] == s2[i]; i++) { + 80497de: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) + 80497e5: eb 18 jmp 80497ff + if (s1[i] == '\0') return 0; + 80497e7: 8b 55 fc mov -0x4(%ebp),%edx + 80497ea: 8b 45 08 mov 0x8(%ebp),%eax + 80497ed: 01 d0 add %edx,%eax + 80497ef: 8a 00 mov (%eax),%al + 80497f1: 84 c0 test %al,%al + 80497f3: 75 07 jne 80497fc + 80497f5: b8 00 00 00 00 mov $0x0,%eax + 80497fa: eb 39 jmp 8049835 + for (i = 0; s1[i] == s2[i]; i++) { + 80497fc: ff 45 fc incl -0x4(%ebp) + 80497ff: 8b 55 fc mov -0x4(%ebp),%edx + 8049802: 8b 45 08 mov 0x8(%ebp),%eax + 8049805: 01 d0 add %edx,%eax + 8049807: 8a 10 mov (%eax),%dl + 8049809: 8b 4d fc mov -0x4(%ebp),%ecx + 804980c: 8b 45 0c mov 0xc(%ebp),%eax + 804980f: 01 c8 add %ecx,%eax + 8049811: 8a 00 mov (%eax),%al + 8049813: 38 c2 cmp %al,%dl + 8049815: 74 d0 je 80497e7 + } + return s1[i] - s2[i]; + 8049817: 8b 55 fc mov -0x4(%ebp),%edx + 804981a: 8b 45 08 mov 0x8(%ebp),%eax + 804981d: 01 d0 add %edx,%eax + 804981f: 8a 00 mov (%eax),%al + 8049821: 0f be d0 movsbl %al,%edx + 8049824: 8b 4d fc mov -0x4(%ebp),%ecx + 8049827: 8b 45 0c mov 0xc(%ebp),%eax + 804982a: 01 c8 add %ecx,%eax + 804982c: 8a 00 mov (%eax),%al + 804982e: 0f be c0 movsbl %al,%eax + 8049831: 29 c2 sub %eax,%edx + 8049833: 89 d0 mov %edx,%eax +} + 8049835: c9 leave + 8049836: c3 ret + +08049837 : + +size_t strlen(const char* str) { + 8049837: 55 push %ebp + 8049838: 89 e5 mov %esp,%ebp + 804983a: 83 ec 10 sub $0x10,%esp + size_t i; + for (i=0;str[i]!='\0';i++); + 804983d: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) + 8049844: eb 03 jmp 8049849 + 8049846: ff 45 fc incl -0x4(%ebp) + 8049849: 8b 55 08 mov 0x8(%ebp),%edx + 804984c: 8b 45 fc mov -0x4(%ebp),%eax + 804984f: 01 d0 add %edx,%eax + 8049851: 8a 00 mov (%eax),%al + 8049853: 84 c0 test %al,%al + 8049855: 75 ef jne 8049846 + return i; + 8049857: 8b 45 fc mov -0x4(%ebp),%eax +} + 804985a: c9 leave + 804985b: c3 ret + +0804985c : + +char* strcpy(char* dest,const char* src) { + 804985c: 55 push %ebp + 804985d: 89 e5 mov %esp,%ebp + 804985f: 83 ec 10 sub $0x10,%esp + size_t i; + for (i=0;i + dest[i]=src[i]; + 804986b: 8b 55 0c mov 0xc(%ebp),%edx + 804986e: 8b 45 fc mov -0x4(%ebp),%eax + 8049871: 01 d0 add %edx,%eax + 8049873: 8b 4d 08 mov 0x8(%ebp),%ecx + 8049876: 8b 55 fc mov -0x4(%ebp),%edx + 8049879: 01 ca add %ecx,%edx + 804987b: 8a 00 mov (%eax),%al + 804987d: 88 02 mov %al,(%edx) + for (i=0;i + 804988a: 83 c4 04 add $0x4,%esp + 804988d: 39 45 fc cmp %eax,-0x4(%ebp) + 8049890: 72 d9 jb 804986b + } + dest[i]='\0'; + 8049892: 8b 55 08 mov 0x8(%ebp),%edx + 8049895: 8b 45 fc mov -0x4(%ebp),%eax + 8049898: 01 d0 add %edx,%eax + 804989a: c6 00 00 movb $0x0,(%eax) + return dest; + 804989d: 8b 45 08 mov 0x8(%ebp),%eax +} + 80498a0: c9 leave + 80498a1: c3 ret + +080498a2 : + +char* strrev(char* str) { + 80498a2: 55 push %ebp + 80498a3: 89 e5 mov %esp,%ebp + 80498a5: 83 ec 10 sub $0x10,%esp + char chr; + int i,j; + for (i=0,j=strlen(str)-1;i + 80498b7: 83 c4 04 add $0x4,%esp + 80498ba: 48 dec %eax + 80498bb: 89 45 f8 mov %eax,-0x8(%ebp) + 80498be: eb 34 jmp 80498f4 + chr=str[i]; + 80498c0: 8b 55 fc mov -0x4(%ebp),%edx + 80498c3: 8b 45 08 mov 0x8(%ebp),%eax + 80498c6: 01 d0 add %edx,%eax + 80498c8: 8a 00 mov (%eax),%al + 80498ca: 88 45 f7 mov %al,-0x9(%ebp) + str[i]=str[j]; + 80498cd: 8b 55 f8 mov -0x8(%ebp),%edx + 80498d0: 8b 45 08 mov 0x8(%ebp),%eax + 80498d3: 01 d0 add %edx,%eax + 80498d5: 8b 4d fc mov -0x4(%ebp),%ecx + 80498d8: 8b 55 08 mov 0x8(%ebp),%edx + 80498db: 01 ca add %ecx,%edx + 80498dd: 8a 00 mov (%eax),%al + 80498df: 88 02 mov %al,(%edx) + str[j]=chr; + 80498e1: 8b 55 f8 mov -0x8(%ebp),%edx + 80498e4: 8b 45 08 mov 0x8(%ebp),%eax + 80498e7: 01 c2 add %eax,%edx + 80498e9: 8a 45 f7 mov -0x9(%ebp),%al + 80498ec: 88 02 mov %al,(%edx) + for (i=0,j=strlen(str)-1;i + } + return str; + 80498fc: 8b 45 08 mov 0x8(%ebp),%eax +} + 80498ff: c9 leave + 8049900: c3 ret + +08049901 : + +void int_to_ascii(int n,char* str) { + 8049901: 55 push %ebp + 8049902: 89 e5 mov %esp,%ebp + 8049904: 83 ec 10 sub $0x10,%esp + int i; + int sign; + if ((sign = n)<0) { + 8049907: 8b 45 08 mov 0x8(%ebp),%eax + 804990a: 89 45 f8 mov %eax,-0x8(%ebp) + 804990d: 83 7d f8 00 cmpl $0x0,-0x8(%ebp) + 8049911: 79 03 jns 8049916 + n=-n; + 8049913: f7 5d 08 negl 0x8(%ebp) + } + i=0; + 8049916: c7 45 fc 00 00 00 00 movl $0x0,-0x4(%ebp) + do { + str[i++]=n%10+'0'; + 804991d: 8b 45 08 mov 0x8(%ebp),%eax + 8049920: b9 0a 00 00 00 mov $0xa,%ecx + 8049925: 99 cltd + 8049926: f7 f9 idiv %ecx + 8049928: 89 d0 mov %edx,%eax + 804992a: 8d 48 30 lea 0x30(%eax),%ecx + 804992d: 8b 45 fc mov -0x4(%ebp),%eax + 8049930: 8d 50 01 lea 0x1(%eax),%edx + 8049933: 89 55 fc mov %edx,-0x4(%ebp) + 8049936: 89 c2 mov %eax,%edx + 8049938: 8b 45 0c mov 0xc(%ebp),%eax + 804993b: 01 d0 add %edx,%eax + 804993d: 88 ca mov %cl,%dl + 804993f: 88 10 mov %dl,(%eax) + } while ((n /= 10) > 0); + 8049941: 8b 4d 08 mov 0x8(%ebp),%ecx + 8049944: b8 67 66 66 66 mov $0x66666667,%eax + 8049949: f7 e9 imul %ecx + 804994b: c1 fa 02 sar $0x2,%edx + 804994e: 89 c8 mov %ecx,%eax + 8049950: c1 f8 1f sar $0x1f,%eax + 8049953: 29 c2 sub %eax,%edx + 8049955: 89 d0 mov %edx,%eax + 8049957: 89 45 08 mov %eax,0x8(%ebp) + 804995a: 83 7d 08 00 cmpl $0x0,0x8(%ebp) + 804995e: 7f bd jg 804991d + if (sign < 0) { + 8049960: 83 7d f8 00 cmpl $0x0,-0x8(%ebp) + 8049964: 79 13 jns 8049979 + str[i++] = '-'; + 8049966: 8b 45 fc mov -0x4(%ebp),%eax + 8049969: 8d 50 01 lea 0x1(%eax),%edx + 804996c: 89 55 fc mov %edx,-0x4(%ebp) + 804996f: 89 c2 mov %eax,%edx + 8049971: 8b 45 0c mov 0xc(%ebp),%eax + 8049974: 01 d0 add %edx,%eax + 8049976: c6 00 2d movb $0x2d,(%eax) + } + str[i]='\0'; + 8049979: 8b 55 fc mov -0x4(%ebp),%edx + 804997c: 8b 45 0c mov 0xc(%ebp),%eax + 804997f: 01 d0 add %edx,%eax + 8049981: c6 00 00 movb $0x0,(%eax) + strrev(str); + 8049984: ff 75 0c pushl 0xc(%ebp) + 8049987: e8 16 ff ff ff call 80498a2 + 804998c: 83 c4 04 add $0x4,%esp +} + 804998f: 90 nop + 8049990: c9 leave + 8049991: c3 ret + +08049992 : + +void hex_to_ascii(unsigned int n, char* str) { + 8049992: 55 push %ebp + 8049993: 89 e5 mov %esp,%ebp + 8049995: 83 ec 18 sub $0x18,%esp + str[0]='\0'; + 8049998: 8b 45 0c mov 0xc(%ebp),%eax + 804999b: c6 00 00 movb $0x0,(%eax) + append(str, '0'); + 804999e: 83 ec 08 sub $0x8,%esp + 80499a1: 6a 30 push $0x30 + 80499a3: ff 75 0c pushl 0xc(%ebp) + 80499a6: e8 cb 00 00 00 call 8049a76 + 80499ab: 83 c4 10 add $0x10,%esp + append(str, 'x'); + 80499ae: 83 ec 08 sub $0x8,%esp + 80499b1: 6a 78 push $0x78 + 80499b3: ff 75 0c pushl 0xc(%ebp) + 80499b6: e8 bb 00 00 00 call 8049a76 + 80499bb: 83 c4 10 add $0x10,%esp + char zeros = 0; + 80499be: c6 45 f7 00 movb $0x0,-0x9(%ebp) + + unsigned int tmp; + int i; + for (i = 28; i > 0; i -= 4) { + 80499c2: c7 45 f0 1c 00 00 00 movl $0x1c,-0x10(%ebp) + 80499c9: eb 61 jmp 8049a2c + tmp = (n >> i) & 0xF; + 80499cb: 8b 45 f0 mov -0x10(%ebp),%eax + 80499ce: 8b 55 08 mov 0x8(%ebp),%edx + 80499d1: 88 c1 mov %al,%cl + 80499d3: d3 ea shr %cl,%edx + 80499d5: 89 d0 mov %edx,%eax + 80499d7: 83 e0 0f and $0xf,%eax + 80499da: 89 45 ec mov %eax,-0x14(%ebp) + if (tmp == 0 && zeros == 0) continue; + 80499dd: 83 7d ec 00 cmpl $0x0,-0x14(%ebp) + 80499e1: 75 06 jne 80499e9 + 80499e3: 80 7d f7 00 cmpb $0x0,-0x9(%ebp) + 80499e7: 74 3e je 8049a27 + zeros = 1; + 80499e9: c6 45 f7 01 movb $0x1,-0x9(%ebp) + if (tmp >= 0xA) append(str, tmp - 0xA + 'a'); + 80499ed: 83 7d ec 09 cmpl $0x9,-0x14(%ebp) + 80499f1: 76 1a jbe 8049a0d + 80499f3: 8b 45 ec mov -0x14(%ebp),%eax + 80499f6: 83 c0 57 add $0x57,%eax + 80499f9: 0f be c0 movsbl %al,%eax + 80499fc: 83 ec 08 sub $0x8,%esp + 80499ff: 50 push %eax + 8049a00: ff 75 0c pushl 0xc(%ebp) + 8049a03: e8 6e 00 00 00 call 8049a76 + 8049a08: 83 c4 10 add $0x10,%esp + 8049a0b: eb 1b jmp 8049a28 + else append(str, tmp + '0'); + 8049a0d: 8b 45 ec mov -0x14(%ebp),%eax + 8049a10: 83 c0 30 add $0x30,%eax + 8049a13: 0f be c0 movsbl %al,%eax + 8049a16: 83 ec 08 sub $0x8,%esp + 8049a19: 50 push %eax + 8049a1a: ff 75 0c pushl 0xc(%ebp) + 8049a1d: e8 54 00 00 00 call 8049a76 + 8049a22: 83 c4 10 add $0x10,%esp + 8049a25: eb 01 jmp 8049a28 + if (tmp == 0 && zeros == 0) continue; + 8049a27: 90 nop + for (i = 28; i > 0; i -= 4) { + 8049a28: 83 6d f0 04 subl $0x4,-0x10(%ebp) + 8049a2c: 83 7d f0 00 cmpl $0x0,-0x10(%ebp) + 8049a30: 7f 99 jg 80499cb + } + + tmp = n & 0xF; + 8049a32: 8b 45 08 mov 0x8(%ebp),%eax + 8049a35: 83 e0 0f and $0xf,%eax + 8049a38: 89 45 ec mov %eax,-0x14(%ebp) + if (tmp >= 0xA) append(str, tmp - 0xA + 'a'); + 8049a3b: 83 7d ec 09 cmpl $0x9,-0x14(%ebp) + 8049a3f: 76 1a jbe 8049a5b + 8049a41: 8b 45 ec mov -0x14(%ebp),%eax + 8049a44: 83 c0 57 add $0x57,%eax + 8049a47: 0f be c0 movsbl %al,%eax + 8049a4a: 83 ec 08 sub $0x8,%esp + 8049a4d: 50 push %eax + 8049a4e: ff 75 0c pushl 0xc(%ebp) + 8049a51: e8 20 00 00 00 call 8049a76 + 8049a56: 83 c4 10 add $0x10,%esp + else append(str, tmp + '0'); +} + 8049a59: eb 18 jmp 8049a73 + else append(str, tmp + '0'); + 8049a5b: 8b 45 ec mov -0x14(%ebp),%eax + 8049a5e: 83 c0 30 add $0x30,%eax + 8049a61: 0f be c0 movsbl %al,%eax + 8049a64: 83 ec 08 sub $0x8,%esp + 8049a67: 50 push %eax + 8049a68: ff 75 0c pushl 0xc(%ebp) + 8049a6b: e8 06 00 00 00 call 8049a76 + 8049a70: 83 c4 10 add $0x10,%esp +} + 8049a73: 90 nop + 8049a74: c9 leave + 8049a75: c3 ret + +08049a76 : + +void append(char* s, char n) { + 8049a76: 55 push %ebp + 8049a77: 89 e5 mov %esp,%ebp + 8049a79: 83 ec 14 sub $0x14,%esp + 8049a7c: 8b 45 0c mov 0xc(%ebp),%eax + 8049a7f: 88 45 ec mov %al,-0x14(%ebp) + int len = strlen(s); + 8049a82: ff 75 08 pushl 0x8(%ebp) + 8049a85: e8 ad fd ff ff call 8049837 + 8049a8a: 83 c4 04 add $0x4,%esp + 8049a8d: 89 45 fc mov %eax,-0x4(%ebp) + s[len] = n; + 8049a90: 8b 55 fc mov -0x4(%ebp),%edx + 8049a93: 8b 45 08 mov 0x8(%ebp),%eax + 8049a96: 01 c2 add %eax,%edx + 8049a98: 8a 45 ec mov -0x14(%ebp),%al + 8049a9b: 88 02 mov %al,(%edx) + s[len+1] = '\0'; + 8049a9d: 8b 45 fc mov -0x4(%ebp),%eax + 8049aa0: 8d 50 01 lea 0x1(%eax),%edx + 8049aa3: 8b 45 08 mov 0x8(%ebp),%eax + 8049aa6: 01 d0 add %edx,%eax + 8049aa8: c6 00 00 movb $0x0,(%eax) +} + 8049aab: 90 nop + 8049aac: c9 leave + 8049aad: c3 ret + +08049aae : + +void backspace(char* s) { + 8049aae: 55 push %ebp + 8049aaf: 89 e5 mov %esp,%ebp + 8049ab1: 83 ec 10 sub $0x10,%esp + int len = strlen(s); + 8049ab4: ff 75 08 pushl 0x8(%ebp) + 8049ab7: e8 7b fd ff ff call 8049837 + 8049abc: 83 c4 04 add $0x4,%esp + 8049abf: 89 45 fc mov %eax,-0x4(%ebp) + s[len-1] = '\0'; + 8049ac2: 8b 45 fc mov -0x4(%ebp),%eax + 8049ac5: 8d 50 ff lea -0x1(%eax),%edx + 8049ac8: 8b 45 08 mov 0x8(%ebp),%eax + 8049acb: 01 d0 add %edx,%eax + 8049acd: c6 00 00 movb $0x0,(%eax) +} + 8049ad0: 90 nop + 8049ad1: c9 leave + 8049ad2: c3 ret + +08049ad3 : + +static const char* strtok_str=NULL; +static size_t strtok_index; + +static char strtok_delim_check(const char* delim) { + 8049ad3: 55 push %ebp + 8049ad4: 89 e5 mov %esp,%ebp + 8049ad6: 83 ec 10 sub $0x10,%esp + for (size_t i=0;i + if (strtok_str[strtok_index]==delim[i]||strtok_str[strtok_index]=='\0') { + 8049ae2: 8b 15 64 d8 04 08 mov 0x804d864,%edx + 8049ae8: a1 68 d8 04 08 mov 0x804d868,%eax + 8049aed: 01 d0 add %edx,%eax + 8049aef: 8a 10 mov (%eax),%dl + 8049af1: 8b 4d 08 mov 0x8(%ebp),%ecx + 8049af4: 8b 45 fc mov -0x4(%ebp),%eax + 8049af7: 01 c8 add %ecx,%eax + 8049af9: 8a 00 mov (%eax),%al + 8049afb: 38 c2 cmp %al,%dl + 8049afd: 74 13 je 8049b12 + 8049aff: 8b 15 64 d8 04 08 mov 0x804d864,%edx + 8049b05: a1 68 d8 04 08 mov 0x804d868,%eax + 8049b0a: 01 d0 add %edx,%eax + 8049b0c: 8a 00 mov (%eax),%al + 8049b0e: 84 c0 test %al,%al + 8049b10: 75 04 jne 8049b16 + return 0; + 8049b12: b0 00 mov $0x0,%al + 8049b14: eb 15 jmp 8049b2b + for (size_t i=0;i + 8049b21: 83 c4 04 add $0x4,%esp + 8049b24: 39 45 fc cmp %eax,-0x4(%ebp) + 8049b27: 72 b9 jb 8049ae2 + } + } + return 1; + 8049b29: b0 01 mov $0x1,%al +} + 8049b2b: c9 leave + 8049b2c: c3 ret + +08049b2d : + +char* strtok(const char* str, const char* delim) { + 8049b2d: 55 push %ebp + 8049b2e: 89 e5 mov %esp,%ebp + 8049b30: 83 ec 18 sub $0x18,%esp + if (str!=NULL) { + 8049b33: 83 7d 08 00 cmpl $0x0,0x8(%ebp) + 8049b37: 74 12 je 8049b4b + strtok_str=str; + 8049b39: 8b 45 08 mov 0x8(%ebp),%eax + 8049b3c: a3 64 d8 04 08 mov %eax,0x804d864 + strtok_index=0; + 8049b41: c7 05 68 d8 04 08 00 movl $0x0,0x804d868 + 8049b48: 00 00 00 + } + if (!strtok_str || strtok_index>strlen(strtok_str)) { + 8049b4b: a1 64 d8 04 08 mov 0x804d864,%eax + 8049b50: 85 c0 test %eax,%eax + 8049b52: 74 18 je 8049b6c + 8049b54: a1 64 d8 04 08 mov 0x804d864,%eax + 8049b59: 50 push %eax + 8049b5a: e8 d8 fc ff ff call 8049837 + 8049b5f: 83 c4 04 add $0x4,%esp + 8049b62: 8b 15 68 d8 04 08 mov 0x804d868,%edx + 8049b68: 39 d0 cmp %edx,%eax + 8049b6a: 73 0a jae 8049b76 + return NULL; + 8049b6c: b8 00 00 00 00 mov $0x0,%eax + 8049b71: e9 9b 00 00 00 jmp 8049c11 + } + char* tok=malloc(sizeof(char)*32); + 8049b76: 83 ec 0c sub $0xc,%esp + 8049b79: 6a 20 push $0x20 + 8049b7b: e8 fd f8 ff ff call 804947d + 8049b80: 83 c4 10 add $0x10,%esp + 8049b83: 89 45 f4 mov %eax,-0xc(%ebp) + tok[0]='\0'; + 8049b86: 8b 45 f4 mov -0xc(%ebp),%eax + 8049b89: c6 00 00 movb $0x0,(%eax) + size_t max_len=32; + 8049b8c: c7 45 f0 20 00 00 00 movl $0x20,-0x10(%ebp) + for (;strtok_delim_check(delim);strtok_index++) { + 8049b93: eb 5c jmp 8049bf1 + if (strlen(tok)+1==max_len) { + 8049b95: 83 ec 0c sub $0xc,%esp + 8049b98: ff 75 f4 pushl -0xc(%ebp) + 8049b9b: e8 97 fc ff ff call 8049837 + 8049ba0: 83 c4 10 add $0x10,%esp + 8049ba3: 40 inc %eax + 8049ba4: 39 45 f0 cmp %eax,-0x10(%ebp) + 8049ba7: 75 1c jne 8049bc5 + tok=realloc(tok,sizeof(char)*(max_len+32)); + 8049ba9: 8b 45 f0 mov -0x10(%ebp),%eax + 8049bac: 83 c0 20 add $0x20,%eax + 8049baf: 83 ec 08 sub $0x8,%esp + 8049bb2: 50 push %eax + 8049bb3: ff 75 f4 pushl -0xc(%ebp) + 8049bb6: e8 ca fa ff ff call 8049685 + 8049bbb: 83 c4 10 add $0x10,%esp + 8049bbe: 89 45 f4 mov %eax,-0xc(%ebp) + max_len+=32; + 8049bc1: 83 45 f0 20 addl $0x20,-0x10(%ebp) + } + append(tok,strtok_str[strtok_index]); + 8049bc5: 8b 15 64 d8 04 08 mov 0x804d864,%edx + 8049bcb: a1 68 d8 04 08 mov 0x804d868,%eax + 8049bd0: 01 d0 add %edx,%eax + 8049bd2: 8a 00 mov (%eax),%al + 8049bd4: 0f be c0 movsbl %al,%eax + 8049bd7: 83 ec 08 sub $0x8,%esp + 8049bda: 50 push %eax + 8049bdb: ff 75 f4 pushl -0xc(%ebp) + 8049bde: e8 93 fe ff ff call 8049a76 + 8049be3: 83 c4 10 add $0x10,%esp + for (;strtok_delim_check(delim);strtok_index++) { + 8049be6: a1 68 d8 04 08 mov 0x804d868,%eax + 8049beb: 40 inc %eax + 8049bec: a3 68 d8 04 08 mov %eax,0x804d868 + 8049bf1: 83 ec 0c sub $0xc,%esp + 8049bf4: ff 75 0c pushl 0xc(%ebp) + 8049bf7: e8 d7 fe ff ff call 8049ad3 + 8049bfc: 83 c4 10 add $0x10,%esp + 8049bff: 84 c0 test %al,%al + 8049c01: 75 92 jne 8049b95 + } + strtok_index++; + 8049c03: a1 68 d8 04 08 mov 0x804d868,%eax + 8049c08: 40 inc %eax + 8049c09: a3 68 d8 04 08 mov %eax,0x804d868 + return tok; + 8049c0e: 8b 45 f4 mov -0xc(%ebp),%eax +} + 8049c11: c9 leave + 8049c12: c3 ret + +08049c13 : +#include + +#define QUAUX(X) #X +#define QU(X) QUAUX(X) + +void yield() { + 8049c13: 55 push %ebp + 8049c14: 89 e5 mov %esp,%ebp + 8049c16: 53 push %ebx + asm volatile(" \ + 8049c17: b8 00 00 00 00 mov $0x0,%eax + 8049c1c: 89 c3 mov %eax,%ebx + 8049c1e: b8 01 00 00 00 mov $0x1,%eax + 8049c23: cd 50 int $0x50 + mov $" QU(SYSCALL_YIELD) ", %%eax; \ + int $80; \ + "::"b"(0)); +} + 8049c25: 90 nop + 8049c26: 5b pop %ebx + 8049c27: 5d pop %ebp + 8049c28: c3 ret + +08049c29 : + +void create_proc(void* start,void* address_space,void* param1,void* param2) { + 8049c29: 55 push %ebp + 8049c2a: 89 e5 mov %esp,%ebp + 8049c2c: 56 push %esi + 8049c2d: 53 push %ebx + asm volatile(" \ + 8049c2e: 8b 45 08 mov 0x8(%ebp),%eax + 8049c31: 8b 4d 0c mov 0xc(%ebp),%ecx + 8049c34: 8b 55 10 mov 0x10(%ebp),%edx + 8049c37: 8b 75 14 mov 0x14(%ebp),%esi + 8049c3a: 89 c3 mov %eax,%ebx + 8049c3c: b8 00 00 00 00 mov $0x0,%eax + 8049c41: cd 50 int $0x50 + mov $" QU(SYSCALL_CREATEPROC) ", %%eax; \ + int $80; \ + "::"b"(start),"c"(address_space),"d"(param1),"S"(param2)); +} + 8049c43: 90 nop + 8049c44: 5b pop %ebx + 8049c45: 5e pop %esi + 8049c46: 5d pop %ebp + 8049c47: c3 ret + +08049c48 : + +__attribute__((noreturn)) void exit(int code) { + 8049c48: 55 push %ebp + 8049c49: 89 e5 mov %esp,%ebp + 8049c4b: 53 push %ebx + code=code&0xff; + 8049c4c: 81 65 08 ff 00 00 00 andl $0xff,0x8(%ebp) + asm volatile(" \ + 8049c53: 8b 45 08 mov 0x8(%ebp),%eax + 8049c56: 89 c3 mov %eax,%ebx + 8049c58: b8 04 00 00 00 mov $0x4,%eax + 8049c5d: cd 50 int $0x50 + mov $" QU(SYSCALL_EXIT) ", %%eax; \ + int $80; \ + "::"b"(code)); + for(;;); + 8049c5f: eb fe jmp 8049c5f + +08049c61 : +} + + +void block_thread(thread_state state) { + 8049c61: 55 push %ebp + 8049c62: 89 e5 mov %esp,%ebp + 8049c64: 53 push %ebx + asm volatile(" \ + 8049c65: 8b 45 08 mov 0x8(%ebp),%eax + 8049c68: 89 c3 mov %eax,%ebx + 8049c6a: b8 02 00 00 00 mov $0x2,%eax + 8049c6f: cd 50 int $0x50 + mov $" QU(SYSCALL_BLOCK) ", %%eax; \ + int $80; \ + "::"b"(state)); +} + 8049c71: 90 nop + 8049c72: 5b pop %ebx + 8049c73: 5d pop %ebp + 8049c74: c3 ret + +08049c75 : + +void unblock_thread(pid_t pid,pid_t tid) { + 8049c75: 55 push %ebp + 8049c76: 89 e5 mov %esp,%ebp + 8049c78: 53 push %ebx + asm volatile(" \ + 8049c79: 8b 45 08 mov 0x8(%ebp),%eax + 8049c7c: 8b 55 0c mov 0xc(%ebp),%edx + 8049c7f: 89 c3 mov %eax,%ebx + 8049c81: 89 d1 mov %edx,%ecx + 8049c83: b8 03 00 00 00 mov $0x3,%eax + 8049c88: cd 50 int $0x50 + mov $" QU(SYSCALL_UNBLOCK) ", %%eax; \ + int $80; \ + "::"b"(pid),"c"(tid)); +} + 8049c8a: 90 nop + 8049c8b: 5b pop %ebx + 8049c8c: 5d pop %ebp + 8049c8d: c3 ret + +08049c8e : + +char check_proc_exists(pid_t pid) { + 8049c8e: 55 push %ebp + 8049c8f: 89 e5 mov %esp,%ebp + 8049c91: 53 push %ebx + 8049c92: 83 ec 10 sub $0x10,%esp + char exists; + asm volatile(" \ + 8049c95: 8b 45 08 mov 0x8(%ebp),%eax + 8049c98: 89 c3 mov %eax,%ebx + 8049c9a: b8 14 00 00 00 mov $0x14,%eax + 8049c9f: cd 50 int $0x50 + 8049ca1: 88 c8 mov %cl,%al + 8049ca3: 88 45 fb mov %al,-0x5(%ebp) + mov $" QU(SYSCALL_CHECK_PROC_EXISTS) ", %%eax; \ + int $80; \ + ":"=c"(exists):"b"(pid)); + return exists; + 8049ca6: 8a 45 fb mov -0x5(%ebp),%al +} + 8049ca9: 83 c4 10 add $0x10,%esp + 8049cac: 5b pop %ebx + 8049cad: 5d pop %ebp + 8049cae: c3 ret + +08049caf : + +#define QUAUX(X) #X +#define QU(X) QUAUX(X) + + +void* rpc_call(pid_t pid,char* name,void* buf,size_t size) { + 8049caf: 55 push %ebp + 8049cb0: 89 e5 mov %esp,%ebp + 8049cb2: 57 push %edi + 8049cb3: 56 push %esi + 8049cb4: 53 push %ebx + 8049cb5: 83 ec 10 sub $0x10,%esp + void* retbuf; + asm volatile(" \ + 8049cb8: 8b 45 08 mov 0x8(%ebp),%eax + 8049cbb: 8b 4d 0c mov 0xc(%ebp),%ecx + 8049cbe: 8b 55 10 mov 0x10(%ebp),%edx + 8049cc1: 8b 75 14 mov 0x14(%ebp),%esi + 8049cc4: 89 c3 mov %eax,%ebx + 8049cc6: b8 0f 00 00 00 mov $0xf,%eax + 8049ccb: cd 50 int $0x50 + 8049ccd: 89 f8 mov %edi,%eax + 8049ccf: 89 45 f0 mov %eax,-0x10(%ebp) + mov $" QU(SYSCALL_CALL_RPC) ", %%eax; \ + int $80; \ + ":"=D"(retbuf):"b"(pid),"c"(name),"d"(buf),"S"(size)); + return retbuf; + 8049cd2: 8b 45 f0 mov -0x10(%ebp),%eax +} + 8049cd5: 83 c4 10 add $0x10,%esp + 8049cd8: 5b pop %ebx + 8049cd9: 5e pop %esi + 8049cda: 5f pop %edi + 8049cdb: 5d pop %ebp + 8049cdc: c3 ret + +08049cdd : + +void rpc_register_func(char* name,rpc_func code) { + 8049cdd: 55 push %ebp + 8049cde: 89 e5 mov %esp,%ebp + 8049ce0: 53 push %ebx + asm volatile(" \ + 8049ce1: 8b 45 08 mov 0x8(%ebp),%eax + 8049ce4: 8b 55 0c mov 0xc(%ebp),%edx + 8049ce7: 89 c3 mov %eax,%ebx + 8049ce9: 89 d1 mov %edx,%ecx + 8049ceb: b8 10 00 00 00 mov $0x10,%eax + 8049cf0: cd 50 int $0x50 + mov $" QU(SYSCALL_REGISTER_RPC) ", %%eax; \ + int $80; \ + "::"b"(name),"c"(code)); +} + 8049cf2: 90 nop + 8049cf3: 5b pop %ebx + 8049cf4: 5d pop %ebp + 8049cf5: c3 ret + +08049cf6 : + +void rpc_deallocate_buf(void* buf,size_t size) { + 8049cf6: 55 push %ebp + 8049cf7: 89 e5 mov %esp,%ebp + 8049cf9: 53 push %ebx + asm volatile(" \ + 8049cfa: 8b 45 08 mov 0x8(%ebp),%eax + 8049cfd: 8b 55 0c mov 0xc(%ebp),%edx + 8049d00: 89 c3 mov %eax,%ebx + 8049d02: 89 d1 mov %edx,%ecx + 8049d04: b8 11 00 00 00 mov $0x11,%eax + 8049d09: cd 50 int $0x50 + mov $" QU(SYSCALL_DEALLOCTATE_RPC_RET) ", %%eax; \ + int $80; \ + "::"b"(buf),"c"(size)); +} + 8049d0b: 90 nop + 8049d0c: 5b pop %ebx + 8049d0d: 5d pop %ebp + 8049d0e: c3 ret + +08049d0f : + +void rpc_return(void* buf,size_t size) { + 8049d0f: 55 push %ebp + 8049d10: 89 e5 mov %esp,%ebp + 8049d12: 53 push %ebx + asm volatile(" \ + 8049d13: 8b 45 08 mov 0x8(%ebp),%eax + 8049d16: 8b 55 0c mov 0xc(%ebp),%edx + 8049d19: 89 c3 mov %eax,%ebx + 8049d1b: 89 d1 mov %edx,%ecx + 8049d1d: b8 12 00 00 00 mov $0x12,%eax + 8049d22: cd 50 int $0x50 + mov $" QU(SYSCALL_RPC_RET) ", %%eax; \ + int $80; \ + "::"b"(buf),"c"(size)); +} + 8049d24: 90 nop + 8049d25: 5b pop %ebx + 8049d26: 5d pop %ebp + 8049d27: c3 ret + +08049d28 : + +void rpc_mark_as_init() { + 8049d28: 55 push %ebp + 8049d29: 89 e5 mov %esp,%ebp + asm volatile(" \ + 8049d2b: b8 15 00 00 00 mov $0x15,%eax + 8049d30: cd 50 int $0x50 + mov $" QU(SYSCALL_RPC_MARK_AS_INIT) ", %%eax; \ + int $80; \ + "::); +} + 8049d32: 90 nop + 8049d33: 5d pop %ebp + 8049d34: c3 ret + +08049d35 : +char rpc_is_init(pid_t pid) { + 8049d35: 55 push %ebp + 8049d36: 89 e5 mov %esp,%ebp + 8049d38: 53 push %ebx + 8049d39: 83 ec 10 sub $0x10,%esp + char is_init; + asm volatile(" \ + 8049d3c: 8b 45 08 mov 0x8(%ebp),%eax + 8049d3f: 89 c3 mov %eax,%ebx + 8049d41: b8 16 00 00 00 mov $0x16,%eax + 8049d46: cd 50 int $0x50 + 8049d48: 88 c8 mov %cl,%al + 8049d4a: 88 45 fb mov %al,-0x5(%ebp) + mov $" QU(SYSCALL_RPC_IS_INIT) ", %%eax; \ + int $80; \ + ":"=c"(is_init):"b"(pid)); + return is_init; + 8049d4d: 8a 45 fb mov -0x5(%ebp),%al +} + 8049d50: 83 c4 10 add $0x10,%esp + 8049d53: 5b pop %ebx + 8049d54: 5d pop %ebp + 8049d55: c3 ret + +08049d56 : +#include +#include +#include + +void serialize_int(int num,serdes_state* state) { + 8049d56: 55 push %ebp + 8049d57: 89 e5 mov %esp,%ebp + 8049d59: 83 ec 08 sub $0x8,%esp + state->buf=realloc(state->buf,state->sizeorpos+sizeof(int)); + 8049d5c: 8b 45 0c mov 0xc(%ebp),%eax + 8049d5f: 8b 40 04 mov 0x4(%eax),%eax + 8049d62: 8d 50 04 lea 0x4(%eax),%edx + 8049d65: 8b 45 0c mov 0xc(%ebp),%eax + 8049d68: 8b 00 mov (%eax),%eax + 8049d6a: 83 ec 08 sub $0x8,%esp + 8049d6d: 52 push %edx + 8049d6e: 50 push %eax + 8049d6f: e8 11 f9 ff ff call 8049685 + 8049d74: 83 c4 10 add $0x10,%esp + 8049d77: 8b 55 0c mov 0xc(%ebp),%edx + 8049d7a: 89 02 mov %eax,(%edx) + *((int*)(state->buf+state->sizeorpos))=num; + 8049d7c: 8b 45 0c mov 0xc(%ebp),%eax + 8049d7f: 8b 10 mov (%eax),%edx + 8049d81: 8b 45 0c mov 0xc(%ebp),%eax + 8049d84: 8b 40 04 mov 0x4(%eax),%eax + 8049d87: 01 c2 add %eax,%edx + 8049d89: 8b 45 08 mov 0x8(%ebp),%eax + 8049d8c: 89 02 mov %eax,(%edx) + state->sizeorpos+=sizeof(int); + 8049d8e: 8b 45 0c mov 0xc(%ebp),%eax + 8049d91: 8b 40 04 mov 0x4(%eax),%eax + 8049d94: 8d 50 04 lea 0x4(%eax),%edx + 8049d97: 8b 45 0c mov 0xc(%ebp),%eax + 8049d9a: 89 50 04 mov %edx,0x4(%eax) +} + 8049d9d: 90 nop + 8049d9e: c9 leave + 8049d9f: c3 ret + +08049da0 : + +void serialize_ptr(void* ptr,serdes_state* state) { + 8049da0: 55 push %ebp + 8049da1: 89 e5 mov %esp,%ebp + 8049da3: 83 ec 08 sub $0x8,%esp + state->buf=realloc(state->buf,state->sizeorpos+sizeof(void*)); + 8049da6: 8b 45 0c mov 0xc(%ebp),%eax + 8049da9: 8b 40 04 mov 0x4(%eax),%eax + 8049dac: 8d 50 04 lea 0x4(%eax),%edx + 8049daf: 8b 45 0c mov 0xc(%ebp),%eax + 8049db2: 8b 00 mov (%eax),%eax + 8049db4: 83 ec 08 sub $0x8,%esp + 8049db7: 52 push %edx + 8049db8: 50 push %eax + 8049db9: e8 c7 f8 ff ff call 8049685 + 8049dbe: 83 c4 10 add $0x10,%esp + 8049dc1: 8b 55 0c mov 0xc(%ebp),%edx + 8049dc4: 89 02 mov %eax,(%edx) + *((void**)(state->buf+state->sizeorpos))=ptr; + 8049dc6: 8b 45 0c mov 0xc(%ebp),%eax + 8049dc9: 8b 10 mov (%eax),%edx + 8049dcb: 8b 45 0c mov 0xc(%ebp),%eax + 8049dce: 8b 40 04 mov 0x4(%eax),%eax + 8049dd1: 01 c2 add %eax,%edx + 8049dd3: 8b 45 08 mov 0x8(%ebp),%eax + 8049dd6: 89 02 mov %eax,(%edx) + state->sizeorpos+=sizeof(void*); + 8049dd8: 8b 45 0c mov 0xc(%ebp),%eax + 8049ddb: 8b 40 04 mov 0x4(%eax),%eax + 8049dde: 8d 50 04 lea 0x4(%eax),%edx + 8049de1: 8b 45 0c mov 0xc(%ebp),%eax + 8049de4: 89 50 04 mov %edx,0x4(%eax) +} + 8049de7: 90 nop + 8049de8: c9 leave + 8049de9: c3 ret + +08049dea : + +void serialize_ary(void* ary,size_t len,serdes_state* state) { + 8049dea: 55 push %ebp + 8049deb: 89 e5 mov %esp,%ebp + 8049ded: 83 ec 08 sub $0x8,%esp + state->buf=realloc(state->buf,state->sizeorpos+len); + 8049df0: 8b 45 10 mov 0x10(%ebp),%eax + 8049df3: 8b 50 04 mov 0x4(%eax),%edx + 8049df6: 8b 45 0c mov 0xc(%ebp),%eax + 8049df9: 01 c2 add %eax,%edx + 8049dfb: 8b 45 10 mov 0x10(%ebp),%eax + 8049dfe: 8b 00 mov (%eax),%eax + 8049e00: 83 ec 08 sub $0x8,%esp + 8049e03: 52 push %edx + 8049e04: 50 push %eax + 8049e05: e8 7b f8 ff ff call 8049685 + 8049e0a: 83 c4 10 add $0x10,%esp + 8049e0d: 8b 55 10 mov 0x10(%ebp),%edx + 8049e10: 89 02 mov %eax,(%edx) + memcpy(state->buf+state->sizeorpos,ary,len); + 8049e12: 8b 45 10 mov 0x10(%ebp),%eax + 8049e15: 8b 10 mov (%eax),%edx + 8049e17: 8b 45 10 mov 0x10(%ebp),%eax + 8049e1a: 8b 40 04 mov 0x4(%eax),%eax + 8049e1d: 01 d0 add %edx,%eax + 8049e1f: 83 ec 04 sub $0x4,%esp + 8049e22: ff 75 0c pushl 0xc(%ebp) + 8049e25: ff 75 08 pushl 0x8(%ebp) + 8049e28: 50 push %eax + 8049e29: e8 39 f9 ff ff call 8049767 + 8049e2e: 83 c4 10 add $0x10,%esp + state->sizeorpos+=len; + 8049e31: 8b 45 10 mov 0x10(%ebp),%eax + 8049e34: 8b 50 04 mov 0x4(%eax),%edx + 8049e37: 8b 45 0c mov 0xc(%ebp),%eax + 8049e3a: 01 c2 add %eax,%edx + 8049e3c: 8b 45 10 mov 0x10(%ebp),%eax + 8049e3f: 89 50 04 mov %edx,0x4(%eax) +} + 8049e42: 90 nop + 8049e43: c9 leave + 8049e44: c3 ret + +08049e45 : + + +void start_deserialize(char* buf,serdes_state* state) { + 8049e45: 55 push %ebp + 8049e46: 89 e5 mov %esp,%ebp + state->buf=buf; + 8049e48: 8b 45 0c mov 0xc(%ebp),%eax + 8049e4b: 8b 55 08 mov 0x8(%ebp),%edx + 8049e4e: 89 10 mov %edx,(%eax) + state->sizeorpos=0; + 8049e50: 8b 45 0c mov 0xc(%ebp),%eax + 8049e53: c7 40 04 00 00 00 00 movl $0x0,0x4(%eax) +} + 8049e5a: 90 nop + 8049e5b: 5d pop %ebp + 8049e5c: c3 ret + +08049e5d : + +int deserialize_int(serdes_state* state) { + 8049e5d: 55 push %ebp + 8049e5e: 89 e5 mov %esp,%ebp + 8049e60: 83 ec 10 sub $0x10,%esp + int num=*((int*)(state->buf+state->sizeorpos)); + 8049e63: 8b 45 08 mov 0x8(%ebp),%eax + 8049e66: 8b 10 mov (%eax),%edx + 8049e68: 8b 45 08 mov 0x8(%ebp),%eax + 8049e6b: 8b 40 04 mov 0x4(%eax),%eax + 8049e6e: 01 d0 add %edx,%eax + 8049e70: 8b 00 mov (%eax),%eax + 8049e72: 89 45 fc mov %eax,-0x4(%ebp) + state->sizeorpos+=sizeof(int); + 8049e75: 8b 45 08 mov 0x8(%ebp),%eax + 8049e78: 8b 40 04 mov 0x4(%eax),%eax + 8049e7b: 8d 50 04 lea 0x4(%eax),%edx + 8049e7e: 8b 45 08 mov 0x8(%ebp),%eax + 8049e81: 89 50 04 mov %edx,0x4(%eax) + return num; + 8049e84: 8b 45 fc mov -0x4(%ebp),%eax +} + 8049e87: c9 leave + 8049e88: c3 ret + +08049e89 : + +void* deserialize_ptr(serdes_state* state) { + 8049e89: 55 push %ebp + 8049e8a: 89 e5 mov %esp,%ebp + 8049e8c: 83 ec 10 sub $0x10,%esp + void* ptr=*((void**)(state->buf+state->sizeorpos)); + 8049e8f: 8b 45 08 mov 0x8(%ebp),%eax + 8049e92: 8b 10 mov (%eax),%edx + 8049e94: 8b 45 08 mov 0x8(%ebp),%eax + 8049e97: 8b 40 04 mov 0x4(%eax),%eax + 8049e9a: 01 d0 add %edx,%eax + 8049e9c: 8b 00 mov (%eax),%eax + 8049e9e: 89 45 fc mov %eax,-0x4(%ebp) + state->sizeorpos+=sizeof(void*); + 8049ea1: 8b 45 08 mov 0x8(%ebp),%eax + 8049ea4: 8b 40 04 mov 0x4(%eax),%eax + 8049ea7: 8d 50 04 lea 0x4(%eax),%edx + 8049eaa: 8b 45 08 mov 0x8(%ebp),%eax + 8049ead: 89 50 04 mov %edx,0x4(%eax) + return ptr; + 8049eb0: 8b 45 fc mov -0x4(%ebp),%eax +} + 8049eb3: c9 leave + 8049eb4: c3 ret + +08049eb5 : + +void* deserialize_ary(size_t len,serdes_state* state) { + 8049eb5: 55 push %ebp + 8049eb6: 89 e5 mov %esp,%ebp + 8049eb8: 83 ec 18 sub $0x18,%esp + void* ary_in_buf=((void*)(state->buf+state->sizeorpos)); + 8049ebb: 8b 45 0c mov 0xc(%ebp),%eax + 8049ebe: 8b 10 mov (%eax),%edx + 8049ec0: 8b 45 0c mov 0xc(%ebp),%eax + 8049ec3: 8b 40 04 mov 0x4(%eax),%eax + 8049ec6: 01 d0 add %edx,%eax + 8049ec8: 89 45 f4 mov %eax,-0xc(%ebp) + state->sizeorpos+=len; + 8049ecb: 8b 45 0c mov 0xc(%ebp),%eax + 8049ece: 8b 50 04 mov 0x4(%eax),%edx + 8049ed1: 8b 45 08 mov 0x8(%ebp),%eax + 8049ed4: 01 c2 add %eax,%edx + 8049ed6: 8b 45 0c mov 0xc(%ebp),%eax + 8049ed9: 89 50 04 mov %edx,0x4(%eax) + void* ary=malloc(len); + 8049edc: 83 ec 0c sub $0xc,%esp + 8049edf: ff 75 08 pushl 0x8(%ebp) + 8049ee2: e8 96 f5 ff ff call 804947d + 8049ee7: 83 c4 10 add $0x10,%esp + 8049eea: 89 45 f0 mov %eax,-0x10(%ebp) + memcpy(ary,ary_in_buf,len); + 8049eed: 83 ec 04 sub $0x4,%esp + 8049ef0: ff 75 08 pushl 0x8(%ebp) + 8049ef3: ff 75 f4 pushl -0xc(%ebp) + 8049ef6: ff 75 f0 pushl -0x10(%ebp) + 8049ef9: e8 69 f8 ff ff call 8049767 + 8049efe: 83 c4 10 add $0x10,%esp + return ary; + 8049f01: 8b 45 f0 mov -0x10(%ebp),%eax +} + 8049f04: c9 leave + 8049f05: c3 ret + +08049f06 : +float ceilf(float num) { + 8049f06: 55 push %ebp + 8049f07: 89 e5 mov %esp,%ebp + 8049f09: 83 ec 18 sub $0x18,%esp + int inum=(int)num; + 8049f0c: d9 45 08 flds 0x8(%ebp) + 8049f0f: d9 7d ee fnstcw -0x12(%ebp) + 8049f12: 66 8b 45 ee mov -0x12(%ebp),%ax + 8049f16: 80 cc 0c or $0xc,%ah + 8049f19: 66 89 45 ec mov %ax,-0x14(%ebp) + 8049f1d: d9 6d ec fldcw -0x14(%ebp) + 8049f20: db 5d fc fistpl -0x4(%ebp) + 8049f23: d9 6d ee fldcw -0x12(%ebp) + if (num==(float)inum) { + 8049f26: db 45 fc fildl -0x4(%ebp) + 8049f29: d9 45 08 flds 0x8(%ebp) + 8049f2c: da e9 fucompp + 8049f2e: df e0 fnstsw %ax + 8049f30: 80 e4 45 and $0x45,%ah + 8049f33: 80 f4 40 xor $0x40,%ah + 8049f36: 75 05 jne 8049f3d + return (float)inum; + 8049f38: db 45 fc fildl -0x4(%ebp) + 8049f3b: eb 0a jmp 8049f47 + } + return (float)(inum+1); + 8049f3d: 8b 45 fc mov -0x4(%ebp),%eax + 8049f40: 40 inc %eax + 8049f41: 89 45 e8 mov %eax,-0x18(%ebp) + 8049f44: db 45 e8 fildl -0x18(%ebp) +} + 8049f47: c9 leave + 8049f48: c3 ret + +08049f49 : + +double ceil(double num) { + 8049f49: 55 push %ebp + 8049f4a: 89 e5 mov %esp,%ebp + 8049f4c: 83 ec 20 sub $0x20,%esp + 8049f4f: 8b 45 08 mov 0x8(%ebp),%eax + 8049f52: 89 45 e8 mov %eax,-0x18(%ebp) + 8049f55: 8b 45 0c mov 0xc(%ebp),%eax + 8049f58: 89 45 ec mov %eax,-0x14(%ebp) + int inum=(int)num; + 8049f5b: dd 45 e8 fldl -0x18(%ebp) + 8049f5e: d9 7d e6 fnstcw -0x1a(%ebp) + 8049f61: 66 8b 45 e6 mov -0x1a(%ebp),%ax + 8049f65: 80 cc 0c or $0xc,%ah + 8049f68: 66 89 45 e4 mov %ax,-0x1c(%ebp) + 8049f6c: d9 6d e4 fldcw -0x1c(%ebp) + 8049f6f: db 5d fc fistpl -0x4(%ebp) + 8049f72: d9 6d e6 fldcw -0x1a(%ebp) + if (num==(double)inum) { + 8049f75: db 45 fc fildl -0x4(%ebp) + 8049f78: dd 45 e8 fldl -0x18(%ebp) + 8049f7b: da e9 fucompp + 8049f7d: df e0 fnstsw %ax + 8049f7f: 80 e4 45 and $0x45,%ah + 8049f82: 80 f4 40 xor $0x40,%ah + 8049f85: 75 05 jne 8049f8c + return (double)inum; + 8049f87: db 45 fc fildl -0x4(%ebp) + 8049f8a: eb 0a jmp 8049f96 + } + return (double)(inum+1); + 8049f8c: 8b 45 fc mov -0x4(%ebp),%eax + 8049f8f: 40 inc %eax + 8049f90: 89 45 e0 mov %eax,-0x20(%ebp) + 8049f93: db 45 e0 fildl -0x20(%ebp) +} + 8049f96: c9 leave + 8049f97: c3 ret + +08049f98 <__do_global_ctors_aux>: + 8049f98: a1 00 b0 04 08 mov 0x804b000,%eax + 8049f9d: 83 f8 ff cmp $0xffffffff,%eax + 8049fa0: 74 1a je 8049fbc <__do_global_ctors_aux+0x24> + 8049fa2: 55 push %ebp + 8049fa3: 89 e5 mov %esp,%ebp + 8049fa5: 53 push %ebx + 8049fa6: 52 push %edx + 8049fa7: bb 00 b0 04 08 mov $0x804b000,%ebx + 8049fac: ff d0 call *%eax + 8049fae: 83 eb 04 sub $0x4,%ebx + 8049fb1: 8b 03 mov (%ebx),%eax + 8049fb3: 83 f8 ff cmp $0xffffffff,%eax + 8049fb6: 75 f4 jne 8049fac <__do_global_ctors_aux+0x14> + 8049fb8: 58 pop %eax + 8049fb9: 5b pop %ebx + 8049fba: 5d pop %ebp + 8049fbb: c3 ret + 8049fbc: c3 ret + +Disassembly of section .fini: + +08049fbd <_fini>: + 8049fbd: e8 46 e1 ff ff call 8048108 <__do_global_dtors_aux> + 8049fc2: c2 00 00 ret $0x0 diff --git a/init/main.c b/init/main.c index 0f96895..6a4de21 100644 --- a/init/main.c +++ b/init/main.c @@ -9,6 +9,7 @@ #include #include #include +#include typedef struct { char filename[100]; @@ -91,36 +92,6 @@ char load_proc(size_t datapos,char* initrd) { return 1; } -char load_proc_devfs(size_t datapos) { - FILE* initrd=fopen("/dev/initrd","r"); - elf_header header; - fseek(initrd,datapos,SEEK_SET); - fread(&header,sizeof(elf_header),1,initrd); - if (header.magic!=ELF_MAGIC) { - serial_print("Bad magic number ("); - char str[32]; - hex_to_ascii(header.magic,str); - serial_print(str); - serial_print(")\n"); - return 0; - } else { - void* address_space=new_address_space(); - for (int i=0;i0) { - fseek(initrd,pheader.offset+datapos,SEEK_SET); - fread(ptr,sizeof(char),pheader.filesz,initrd); - } - copy_data(address_space,ptr,pheader.memsz,(void*)pheader.vaddr); - } - create_proc((void*)header.entry,address_space,NULL,NULL); - } - return 1; -} int main() { serial_print("Init running\n"); @@ -141,10 +112,15 @@ int main() { datapos=find_loc("initrd_drv",initrd); load_proc(datapos,initrd); while(rpc_is_init(4)==0); - serial_print("Loading VGA driver\n"); - datapos=find_loc("vga_drv",initrd); - load_proc_devfs(datapos); + serial_print("Loading tar_fs\n"); + datapos=find_loc("tar_fs",initrd); + load_proc(datapos,initrd); while(rpc_is_init(5)==0); + serial_print("Mounting initrd\n"); + mount("/dev/initrd","tarfs","/initrd"); + serial_print("Loading VGA driver\n"); + posix_spawn(NULL,"/initrd/vga_drv",NULL,NULL,NULL,NULL); + while(rpc_is_init(6)==0); serial_print("Opening /dev/vga\n"); stdout=fopen("/dev/vga","w"); if (!stdout) { diff --git a/libc/spawn.c b/libc/spawn.c new file mode 100644 index 0000000..c4534d6 --- /dev/null +++ b/libc/spawn.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include + +int posix_spawn(pid_t* pid, const char* path, const posix_spawn_file_actions_t* file_actions, const posix_spawnattr_t* attrp, +char* const argv[], char* const envp[]) { + FILE* image=fopen(path,"r"); + elf_header header; + fread(&header,sizeof(elf_header),1,image); + if (header.magic!=ELF_MAGIC) { + serial_print("Bad magic number ("); + char str[32]; + hex_to_ascii(header.magic,str); + serial_print(str); + serial_print(")\n"); + return 0; + } else { + void* address_space=new_address_space(); + for (int i=0;i0) { + fseek(image,pheader.offset,SEEK_SET); + fread(ptr,sizeof(char),pheader.filesz,image); + } + copy_data(address_space,ptr,pheader.memsz,(void*)pheader.vaddr); + } + create_proc((void*)header.entry,address_space,NULL,NULL); + } + return 1; +} diff --git a/libc/spawn.h b/libc/spawn.h new file mode 100644 index 0000000..961f8b9 --- /dev/null +++ b/libc/spawn.h @@ -0,0 +1,12 @@ +#ifndef SPAWN_H +#define SPAWN_H + +#include + +#define posix_spawn_file_actions_t int +#define posix_spawnattr_t int + +int posix_spawn(pid_t* pid, const char* path, const posix_spawn_file_actions_t* file_actions, const posix_spawnattr_t* attrp, +char* const argv[], char* const envp[]); + +#endif diff --git a/libc/stdio.c b/libc/stdio.c index 013e9a2..a2b2fb5 100644 --- a/libc/stdio.c +++ b/libc/stdio.c @@ -142,8 +142,11 @@ size_t fwrite(void* buffer_ptr,size_t size,size_t count,FILE* stream) { void register_fs(const char* name,pid_t pid) { serdes_state state={0}; + serial_print("libc register fs 1\n"); serialize_str((char*)name,&state); + serial_print("libc register fs 2\n"); serialize_int(pid,&state); + serial_print("libc register fs 3\n"); rpc_call(2,"register_fs",state.buf,state.sizeorpos); } diff --git a/libc/stdlib.c b/libc/stdlib.c index d940661..5fdfb93 100644 --- a/libc/stdlib.c +++ b/libc/stdlib.c @@ -156,7 +156,7 @@ void* realloc(void *mem, size_t new_sz) { } size_t num_4b_grps=*((size_t*)((char*)mem-12)); memcpy(ptr,mem,num_4b_grps*4); - free(mem); + //free(mem); mem=ptr; return ptr; } diff --git a/tar_fs/Makefile b/tar_fs/Makefile new file mode 100644 index 0000000..4ca89b8 --- /dev/null +++ b/tar_fs/Makefile @@ -0,0 +1,13 @@ +C_SOURCES = $(wildcard *.c) +OBJ = $(C_SOURCES:.c=.o ) +CFLAGS = -Wall -g +CC = i386-myos-gcc + +tar_fs: $(OBJ) ../libc/* + @$(CC) -o $@ $(CFLAGS) $(OBJ) + +%.o: %.c + @$(CC) $(CFLAGS) -c $< -o $@ + +clean: + @rm -rf *.o initrd_drv diff --git a/tar_fs/main.c b/tar_fs/main.c new file mode 100644 index 0000000..9ec0ac1 --- /dev/null +++ b/tar_fs/main.c @@ -0,0 +1,139 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef struct { + char filename[100]; + char mode[8]; + char uid[8]; + char gid[8]; + char size[12]; + char mtime[12]; + char chksum[8]; + char typeflag[1]; +} tar_header; + +typedef struct tar_file { + int pos; + char name[100]; + char* dev; + struct tar_file* next; +} tar_file; + +typedef struct { + FILE* access_file; + int base_pos; +} open_file_info; + +size_t getsize(const char *in) { + size_t size=0; + size_t j; + size_t count=1; + for (j=11;j>0;j--,count*=8) { + size+=((in[j-1]-'0')*count); + } + return size; +} + +tar_file* get_file_list(char* dev) { + FILE* tar_archive=fopen(dev,"r"); + size_t pos=0; + tar_header tar_hdr; + tar_file* list=NULL; + for (int i=0;;i++) { + fseek(tar_archive,pos,SEEK_SET); + fread(&tar_hdr,sizeof(tar_header),1,tar_archive); + if (tar_hdr.filename[0]=='\0') break; + size_t size=getsize(tar_hdr.size); + pos+=512; + tar_file* list_entry=malloc(sizeof(tar_file)); + list_entry->pos=pos; + list_entry->dev=dev; + strcpy(list_entry->name,tar_hdr.filename); + list_entry->next=list; + list=list_entry; + pos+=size; + if (pos%512!=0) { + pos+=512-(pos%512); + } + } + return list; +} + +void tar_fs_mount(void* args) { + char* dev=(char*)args; + tar_file* file_list=get_file_list(dev); + serdes_state state; + serialize_int(0,&state); + serialize_ptr(file_list,&state); + rpc_return(state.buf,state.sizeorpos); + free(state.buf); + pthread_exit(NULL); +} + +void open(void* args) { + serdes_state state; + start_deserialize(args,&state); + char* path=deserialize_str(&state); + tar_file* file_list=deserialize_ptr(&state); + for (;file_list!=NULL;file_list=file_list->next) { + if (strcmp(path,file_list->name)==0) { + break; + } + } + if (file_list) { + open_file_info* info=malloc(sizeof(open_file_info)); + info->access_file=fopen(file_list->dev,"r"); + info->base_pos=file_list->pos; + state.buf=NULL; + state.sizeorpos=0; + serialize_int(0,&state); + serialize_ptr(info,&state); + serialize_int(0,&state); + rpc_return(state.buf,state.sizeorpos); + pthread_exit(NULL); + } else { + state.buf=NULL; + state.sizeorpos=0; + serialize_int(1,&state); + serialize_ptr(NULL,&state); + serialize_int(0,&state); + rpc_return(state.buf,state.sizeorpos); + pthread_exit(NULL); + } +} + +void read(void* args) { + serdes_state state; + start_deserialize(args,&state); + open_file_info* info=deserialize_ptr(&state); + size_t size=deserialize_int(&state); + int pos=deserialize_int(&state); + rpc_deallocate_buf(args,state.sizeorpos); + char* data=malloc(sizeof(char)*size); + fseek(info->access_file,info->base_pos+pos,SEEK_SET); + fread(data,size,1,info->access_file); + state.buf=NULL; + state.sizeorpos=0; + serialize_int(size,&state); + serialize_ary(data,size,&state); + rpc_return(state.buf,state.sizeorpos); + free(state.buf); + pthread_exit(NULL); +} + +int main() { + rpc_register_func("mount",&tar_fs_mount); + rpc_register_func("open",&open); + rpc_register_func("read",&read); + serial_print("Registering tarfs filesystem\n"); + register_fs("tarfs",getpid()); + serial_print("Initialized tarfs\n"); + rpc_mark_as_init(); +} diff --git a/tar_fs/tar_fs b/tar_fs/tar_fs new file mode 100755 index 0000000000000000000000000000000000000000..10a2d00ac82451d44452a8cb2fd3978d045a45c7 GIT binary patch literal 35212 zcmeHwdwf*Ywf{LYvuDmcl9@aR;UOeEBq$_7d_Vz3WaMol5(UMMA(=cduO<@&D+LKC zF;Ww2t+r8XwXJROQ}3<47pvC`Y6biA-ixhO@X>OW+QHD47FucLc7EUQ-e*tFgkbf) zKKGA~X3k!FJ@#5_uf6tT&N*y~F1_3|O+$ZNhT9<2v)N;vk89&?3Uj_uWVnnHBj3oA zcv%Y?1AnVa41<4yl@UYX%Tay;c>Lv~*a*DW#wSxKBp07$7|*dLQwMO#q z3Jv4=+MZqc5Hg2fiP5`Ay=`|Qud?fxok#QQS)1D5`9kES=X;*tvCfdRQ(4>f+@3$X z_9Vxe`(HVk82v-Z_Y<2hQlS`sA{oiIc}@{{jE-u^z51%BLjZ2=xA48^L)VgLS$KE? zzGfb1&+D1{2#cxw+w7{g-y~P1QYo!kr1NN~e&>T8EBVmpKl}hKyeKH!+z~%{-Dj?c zJyK8Gjz=#ej z`KSl*3z4p95~6{F=ws?~l$Y-4iO!>*weE^kM>6?(NYbLX)~tU3*d5z0gMt;w;pjF9 zxkG|mcZav$4I~_)@SVGFsYqT3LfOvYThWe7qSv-2&9LO`iXQ5&JkcFJ)D^*3ccs-; zQIEoo3J-L(TUnm`ey${z6vw(M8c82L)*U@;M!|bxVhXN7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ADY9ydglyw710SafpJ`7&L01C)w+FHa}>W!j2j^CnLc?E8M)CzHuat z-2bS<5a)IQTH)|!h#drWjdH`Ux(_=O#~#=|gONukIHAE2nc9ECDcoiAlw$C9lHG=F zb9zSu3z{3`aSFRsp6aPXH~XkgovtY3#q=@H>ANL)pkb7@Z)i$Xt-%#X5As^COY#he;G+rN*qu(f%qu3~wDFYWC8kWMZK(sV9;dBml@iiTFG3>&dxrMVqd5Wk} zYt}HlY^agjYP$?YbkSyKdjD9TQJ~@yjXNc-8}Jl<#x909ev0v@={Udl0KWb#V$>&M zUnk+J={OJm8Z>gUvGH2oRGSVN+TecfBYueiw1C7|0(g#FRQR=~PU)IU!%j0gFApZ(FeTL9}aQP*FI z-)9`#SdF`55Z(UO(3P(lus@paUcfACJB-ib-_&qy{fXn>!}b*y`RQ7Zb+ra?B@I8k zvTyZ=kB#%+g1~d8#)bH!&m;I_m&?Azm7m0|SVuWJM9a$o&Pn&oHoPBDa;Ps&_x}M) CA^AK2 literal 0 HcmV?d00001 diff --git a/vfs/main.c b/vfs/main.c index c54ec06..1f6ebe1 100644 --- a/vfs/main.c +++ b/vfs/main.c @@ -74,6 +74,7 @@ void vfs_mount(void* args) { } void vfs_register_fs(void* args) { + serial_print("register fs\n"); serdes_state state; start_deserialize(args,&state); char* name=deserialize_str(&state); @@ -119,6 +120,7 @@ void open(void* args) { state.buf=NULL; state.sizeorpos=0; serialize_str(path+(strlen(mnt_pnt->path)+1),&state); + serialize_ptr(mnt_pnt->fs_data,&state); char* retbuf=rpc_call(mnt_pnt->fs_pid,"open",state.buf,state.sizeorpos); free(state.buf); start_deserialize(retbuf,&state);