/* nfsmount - small footprint mount for NFS shares Copyright (C) 2004 jc@jcomeau.com This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ .section .text .global _start .equ _start, cold cold: mov $source, %ebx mov $test_target, %ecx /* use test_target while testing on bootserver! */ mov $fstype, %edx mov mountflags, %esi mov $nfsdata, %edi mov $21, %eax /* SYS_mount */ int $0x80 /* syscall */ mov %eax, %ebx /* return code */ mov $1, %eax /* SYS_exit */ int $0x80 .section .data source: .asciz "127.0.0.1:/KNOPPIX" test_target: .asciz "/mnt/test" target: .asciz "/KNOPPIX" fstype: .asciz "nfs" mountflags: .int 0xc0ed0000 /* this "magic number" not required on kernels >= 2.4 */ nfsdata: /* find this struct in nfsmount.h */ version: .int 2 /* first version is simplest! K.I.S.S. */ fd: .int 0 /* not sure what this is for, but nfsroot.c doesn't use it */ old_root: .int 0, 0, 0, 0, 0, 0, 0, 0 /* 32 byte struct nfs2_fh */ flags: .int 0 rsize: .int 4096 /* largest possible in v2 is 8192 */ wsize: .int 4096 timeo: .int 7 /* just using what I found in nfsroot.c */ retrans: .int 3 /* ditto on down the line */ acregmin: .int 3 acregmax: .int 60 acdirmin: .int 30 acdirmax: .int 60 addr: /* struct sockaddr_in */ sin_family: .short 2 /* AF_INET */ sin_port: .short 0 /* any old port */ sin_addr: .byte 127, 0, 0, 1 /* fill this in with packed IP number */ .rept 14 - (. - sin_port) /* pad to 14 bytes */ .byte 0 .endr hostname: /* 256 bytes, whether you need it or not */ .ascii "127.0.0.1" .equ hostname_length, (. - hostname) .rept 256 - hostname_length .byte 0 .endr namelen: /* only needed for version 2 or above */ .int hostname_length .asciz "___the_end___" /* just to see how this compiled */ .equ _end, .