Skip to content

Commit

Permalink
libraries compiled
Browse files Browse the repository at this point in the history
  • Loading branch information
akailash committed Oct 21, 2011
1 parent b78a575 commit 9d8cee9
Show file tree
Hide file tree
Showing 16 changed files with 1,280 additions and 0 deletions.
51 changes: 51 additions & 0 deletions include/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# Doing a make includes builds /usr/include

INCS= alloca.h ansi.h a.out.h ar.h assert.h configfile.h ctype.h \
curses.h dirent.h env.h err.h errno.h fcntl.h fenv.h \
float.h fnmatch.h fts.h getopt.h glob.h grp.h ifaddrs.h \
inttypes.h libgen.h lib.h libutil.h limits.h locale.h \
mathconst.h math.h midiparser.h netdb.h pwd.h regex.h \
regexp.h setjmp.h sgtty.h signal.h stdarg.h stddef.h \
stdint.h stdbool.h stdio.h stdlib.h string.h strings.h sysexits.h \
syslog.h tar.h termcap.h termios.h time.h timers.h tools.h \
ttyent.h ucontext.h unistd.h utime.h utmp.h wchar.h wctype.h \
hgfs.h tzfile.h util.h fetch.h mpool.h ndbm.h db.h poll.h resolv.h
INCS+= arpa/inet.h arpa/nameser.h
INCS+= minix/a.out.h minix/bitmap.h minix/callnr.h minix/cdrom.h \
minix/com.h minix/config.h minix/const.h minix/cpufeature.h \
minix/crtso.h minix/debug.h minix/devio.h minix/dirent.h \
minix/dir.h minix/dl_eth.h minix/dmap.h minix/driver.h \
minix/limits.h \
minix/acpi.h \
minix/drivers.h minix/drvlib.h minix/ds.h minix/endpoint.h \
minix/fslib.h minix/ioctl.h minix/ipc.h minix/ipcconst.h \
minix/keymap.h minix/minlib.h minix/mq.h \
minix/netdriver.h minix/partition.h minix/paths.h \
minix/portio.h minix/priv.h minix/profile.h minix/queryparam.h \
minix/rs.h minix/safecopies.h minix/sched.h minix/sef.h minix/sound.h \
minix/spin.h minix/sys_config.h minix/sysinfo.h minix/syslib.h \
minix/sysutil.h minix/timers.h minix/tty.h minix/type.h minix/types.h \
minix/u64.h minix/vfsif.h minix/vm.h minix/vtreefs.h minix/gcov.h \
minix/compiler.h minix/compiler-ack.h minix/sha2.h minix/sha1.h minix/md5.h \
minix/audio_fw.h minix/libmsgque.h
INCS+= net/hton.h net/if.h net/ioctl.h net/netlib.h
INCS+= net/gen/arp_io.h net/gen/dhcp.h net/gen/ether.h \
net/gen/eth_hdr.h net/gen/eth_io.h net/gen/icmp.h \
net/gen/icmp_hdr.h net/gen/if_ether.h net/gen/inet.h \
net/gen/in.h net/gen/ip_hdr.h net/gen/ip_io.h \
net/gen/nameser.h net/gen/netdb.h net/gen/oneCsum.h \
net/gen/psip_hdr.h net/gen/psip_io.h net/gen/resolv.h \
net/gen/rip.h net/gen/route.h net/gen/socket.h \
net/gen/tcp.h net/gen/tcp_hdr.h net/gen/tcp_io.h \
net/gen/udp.h net/gen/udp_hdr.h net/gen/udp_io.h \
net/gen/vjhc.h
INCS+= netinet/if_ether.h netinet/in.h netinet/tcp.h

.include <bsd.own.mk>

INCSDIR= /usr/include

SUBDIR= sys arch

.include <bsd.prog.mk>
.include <bsd.subdir.mk>
127 changes: 127 additions & 0 deletions include/minix/callnr.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#define NCALLS 118 /* number of system calls allowed */

#define EXIT 1
#define FORK 2
#define READ 3
#define WRITE 4
#define OPEN 5
#define CLOSE 6
#define WAIT 7
#define CREAT 8
#define LINK 9
#define UNLINK 10
#define WAITPID 11
#define CHDIR 12
#define TIME 13
#define MKNOD 14
#define CHMOD 15
#define CHOWN 16
#define BRK 17
#define STAT 18
#define LSEEK 19
#define MINIX_GETPID 20
#define MOUNT 21
#define UMOUNT 22
#define SETUID 23
#define GETUID 24
#define STIME 25
#define PTRACE 26
#define ALARM 27
#define FSTAT 28
#define PAUSE 29
#define UTIME 30
#define ACCESS 33
#define SYNC 36
#define KILL 37
#define RENAME 38
#define MKDIR 39
#define RMDIR 40
#define DUP 41
#define PIPE 42
#define TIMES 43
#define SYMLINK 45
#define SETGID 46
#define GETGID 47
#define SIGNAL 48
#define RDLNK 49
#define LSTAT 50
#define IOCTL 54
#define FCNTL 55
#define FS_READY 57
#define EXEC 59
#define UMASK 60
#define CHROOT 61
#define SETSID 62
#define GETPGRP 63
#define ITIMER 64
#define GETGROUPS 65
#define SETGROUPS 66
#define GETMCONTEXT 67
#define SETMCONTEXT 68


/* Posix signal handling. */
#define SIGACTION 71
#define SIGSUSPEND 72
#define SIGPENDING 73
#define SIGPROCMASK 74
#define SIGRETURN 75

#define REBOOT 76
#define SVRCTL 77
#define SYSUNAME 78
#define GETSYSINFO 79 /* to PM, VFS, RS, or DS */
#define GETDENTS 80 /* to FS */
#define LLSEEK 81 /* to VFS */
#define FSTATFS 82 /* to VFS */
#define STATVFS 83 /* to VFS */
#define FSTATVFS 84 /* to VFS */
#define SELECT 85 /* to VFS */
#define FCHDIR 86 /* to VFS */
#define FSYNC 87 /* to VFS */
#define GETPRIORITY 88 /* to PM */
#define SETPRIORITY 89 /* to PM */
#define GETTIMEOFDAY 90 /* to PM */
#define SETEUID 91 /* to PM */
#define SETEGID 92 /* to PM */
#define TRUNCATE 93 /* to VFS */
#define FTRUNCATE 94 /* to VFS */
#define FCHMOD 95 /* to VFS */
#define FCHOWN 96 /* to VFS */
#define GETSYSINFO_UP 97 /* to PM or VFS */
#define SPROF 98 /* to PM */
#define CPROF 99 /* to PM */

/* Calls provided by PM and FS that are not part of the API */
#define EXEC_NEWMEM 100 /* from VFS or RS to PM: new memory map for
* exec
*/
#define SRV_FORK 101 /* to PM: special fork call for RS */
#define EXEC_RESTART 102 /* to PM: final part of exec for RS */
#define PROCSTAT 103 /* to PM */
#define GETPROCNR 104 /* to PM */

#define GETEPINFO 107 /* to PM: get pid/uid/gid of an endpoint */
#define ADDDMA 108 /* to PM: inform PM about a region of memory
* that is used for bus-master DMA
*/
#define DELDMA 109 /* to PM: inform PM that a region of memory
* that is no longer used for bus-master DMA
*/
#define GETDMA 110 /* to PM: ask PM for a region of memory
* that should not be used for bus-master DMA
* any longer
*/
#define SRV_KILL 111 /* to PM: special kill call for RS */

#define GCOV_FLUSH 112 /* flush gcov data from server to gcov files */

#define MINIT 113
#define MRECV 114
#define MSEND 115
#define MCLOSE 116
#define MCLEAN 117
#define TASK_REPLY 121 /* to VFS: reply code from drivers, not
* really a standalone call.
*/
#define MAPDRIVER 122 /* to VFS, map a device */
22 changes: 22 additions & 0 deletions include/minix/libmsgque.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Message Queue Multicast Implementation
* CS551 Group 21
*
* Multicast Message Queue User syscall's
* and structures associated with it
*/

PUBLIC struct MsgQue {
int token; /* This identifies the Message Queue uniquely
* Multiple applications can use same key to
* operate of single queue in multicast mode */

void *queue; /* This is pointer used by kernel to point to
* kernel message queue data structure, to avoid
* token look-up every time for all API's.
* msend() without minit() scenarios can
* check if *queue is invalid and return */

};


119 changes: 119 additions & 0 deletions lib_libc_posix/Makefile.inc
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
# posix sources
.PATH: ${.CURDIR}/posix

SRCS+= \
__exit.c \
_access.c \
_alarm.c \
_cfgetispeed.c \
_cfgetospeed.c \
_cfsetispeed.c \
_cfsetospeed.c \
_chdir.c \
_chmod.c \
_chown.c \
_chroot.c \
_close.c \
_closedir.c \
_creat.c \
_dup.c \
_dup2.c \
_execl.c \
_execle.c \
_execlp.c \
_execv.c \
_execve.c \
_execvp.c \
_fchmod.c \
_fchown.c \
_fcntl.c \
_fork.c \
_fpathconf.c \
_fstat.c \
_fstatfs.c \
_fstatvfs.c \
_fsync.c \
_getcwd.c \
_getegid.c \
_geteuid.c \
_getgid.c \
_getgroups.c \
_getitimer.c \
_getpgrp.c \
_getpid.c \
_getppid.c \
_getuid.c \
_ioctl.c \
_isatty.c \
_kill.c \
_killpg.c \
_link.c \
_lseek.c \
_lstat.c \
_mclean.c \
_mkdir.c \
_mkfifo.c \
_mknod.c \
_mmap.c \
_minit.c \
_mclose.c \
_msend.c \
_mrecv.c \
_nanosleep.c \
_open.c \
_opendir.c \
_pathconf.c \
_pause.c \
_pipe.c \
_ptrace.c \
_read.c \
_readdir.c \
_readlink.c \
_rename.c \
_rewinddir.c \
_rmdir.c \
_select.c \
_setgid.c \
_setitimer.c \
_setsid.c \
_setuid.c \
_sigaction.c \
_sigpending.c \
_sigprocmask.c \
_sigreturn.c \
_sigset.c \
_sigsuspend.c \
_sleep.c \
_stat.c \
_statvfs.c \
_stime.c \
_symlink.c \
_sync.c \
_tcdrain.c \
_tcflow.c \
_tcflush.c \
_tcgetattr.c \
_tcsendbreak.c \
_tcsetattr.c \
_time.c \
_times.c \
_truncate.c \
_ucontext.c \
_umask.c \
_uname.c \
_unlink.c \
_utime.c \
_wait.c \
_waitpid.c \
_write.c \
fnmatch.c \
getloadavg.c \
getopt.c \
gettimeofday.c \
glob.c \
nice.c \
priority.c \
pread.c \
pwrite.c \
usleep.c \
poll.c
26 changes: 26 additions & 0 deletions lib_libc_posix/_mclean.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/* Message Queue Multicast Implementation
* CS551 Group 21
*
*
* Message Queue User Library Interface function
* definitions are here. These definitions go into
* libmsend.so, which is expected to be linked with
* user executable.
*/
#include <lib.h>
#include <unistd.h>

#include <minix/libmsgque.h>


/* This API is used to clean-up message queue resource
* at PM, if and only if there are NO active processes that
* have registered the message queue.
*/
PUBLIC int mclean( struct MsgQue *msgque )
{
message m;

m.m1_p1 = (void *)msgque;
return(_syscall(PM_PROC_NR, MCLEAN, &m));
}
29 changes: 29 additions & 0 deletions lib_libc_posix/_mclose.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

/* CS551 Group 21
*
*
* Message Queue User Library Interface function
* definitions are here. These definitions go into
* libmsend.so, which is expected to be linked with
* user executable.
*/
#include <lib.h>
#include <unistd.h>

#include <minix/libmsgque.h>


/* This API is used to de-register from particular
* message queue. It does not destroy the message queue,
* as there could be other users using the message queue.
* The last user calling mclose() will cause message queue
* to be destroyed.
*/
PUBLIC int mclose( msgque )
struct MsgQue *msgque;
{
message m;

m.m1_p1 = (void*) msgque;
return(_syscall(PM_PROC_NR, MCLOSE, &m));
}
Loading

0 comments on commit 9d8cee9

Please sign in to comment.