00001
00005 #include "routix/system.h"
00006 #include "routix/task.h"
00007 #include <routix/kstdio.h>
00008
00009
00010 extern task_struct_t *actual;
00011
00012
00013 char error_types[][55] = {
00014 "OK",
00015 "Operation not permitted",
00016 "No such file or directory",
00017 "No such process",
00018 "Interrupted system call",
00019 "I/O error",
00020 "No such device or address",
00021 "Arg list too long",
00022 "Exec format error",
00023 "Bad file number",
00024 "No child processes",
00025 "Try again",
00026 "Out of memory",
00027 "Permission denied",
00028 "Bad address",
00029 "Block device required",
00030 "Device or resource busy",
00031 "File exists",
00032 "Cross-device link",
00033 "No such device",
00034 "Not a directory",
00035 "Is a directory",
00036 "Invalid argument",
00037 "File table overflow",
00038 "Too many open files",
00039 "Not a typewriter",
00040 "Text file busy",
00041 "File too large",
00042 "No space left on device",
00043 "Illegal seek",
00044 "Read-only file system",
00045 "Too many links",
00046 "Broken pipe",
00047 "Math argument out of domain of func",
00048 "Math result not representable",
00049 "Resource deadlock would occur",
00050 "File name too long",
00051 "No record locks available",
00052 "Function not implemented",
00053 "Directory not empty",
00054 "Too many symbolic links encountered",
00055 "Operation would block",
00056 "No message of desired type",
00057 "Identifier removed",
00058 "Channel number out of range",
00059 "Level 2 not synchronized",
00060 "Level 3 halted",
00061 "Level 3 reset",
00062 "Link number out of range",
00063 "Protocol driver not attached",
00064 "No CSI structure available",
00065 "Level 2 halted",
00066 "Invalid exchange",
00067 "Invalid request descriptor",
00068 "Exchange full",
00069 "No anode",
00070 "Invalid request code",
00071 "Invalid slot",
00072 "File locking deadlock error",
00073 "Bad font file format",
00074 "Device not a stream",
00075 "No data available",
00076 "Timer expired",
00077 "Out of streams resources",
00078 "Machine is not on the network",
00079 "Package not installed",
00080 "Object is remote",
00081 "Link has been severed",
00082 "Advertise error",
00083 "Srmount error",
00084 "Communication error on send",
00085 "Protocol error",
00086 "Multihop attempted",
00087 "RFS specific error",
00088 "Not a data message",
00089 "Value too large for defined data type",
00090 "Name not unique on network",
00091 "File descriptor in bad state",
00092 "Remote address changed",
00093 "Can not access a needed shared library",
00094 "Accessing a corrupted shared library",
00095 ".lib section in a.out corrupted",
00096 "Attempting to link in too many shared libraries",
00097 "Cannot exec a shared library directly",
00098 "Illegal byte sequence",
00099 "Interrupted system call should be restarted",
00100 "Streams pipe error",
00101 "Too many users",
00102 "Socket operation on non-socket",
00103 "Destination address required",
00104 "Message too long",
00105 "Protocol wrong type for socket",
00106 "Protocol not available",
00107 "Protocol not supported",
00108 "Socket type not supported",
00109 "Operation not supported on transport endpoint",
00110 "Protocol family not supported",
00111 "Address family not supported by protocol",
00112 "Address already in use",
00113 "Cannot assign requested address",
00114 "Network is down",
00115 "Network is unreachable",
00116 "Network dropped connection because of reset",
00117 "Software caused connection abort",
00118 "Connection reset by peer",
00119 "No buffer space available",
00120 "Transport endpoint is already connected",
00121 "Transport endpoint is not connected",
00122 "Cannot send after transport endpoint shutdown",
00123 "Too many references: cannot splice",
00124 "Connection timed out",
00125 "Connection refused",
00126 "Host is down",
00127 "No route to host",
00128 "Operation already in progress",
00129 "Operation now in progress",
00130 "Stale NFS file handle",
00131 "Structure needs cleaning",
00132 "Not a XENIX named type file",
00133 "No XENIX semaphores available",
00134 "Is a named type file",
00135 "Remote I/O error",
00136 "Quota exceeded"
00137 };
00138
00139
00140
00141 void perror (char *str)
00142 {
00143 kprintf("%s: %s\n", str, error_types[actual->err_no]);
00144 actual->err_no = 0;
00145 }
00146
00147
00148 void kpanic(char *str)
00149 {
00150 __asm__ __volatile__ ("cli");
00151
00152 kprintf("\nKernel Panic: %s\n", str);
00153 kprintf("Sistema detenido");
00154 while(1);
00155 }