functions.
map(SYS_SAFECOPYFROM, do_safecopy); /* copy with pre-granted permission */
map(SYS_SAFECOPYTO, do_safecopy); /* copy with pre-granted permission */
map(SYS_VSAFECOPY, do_vsafecopy); /* vectored safecopy */
+ map(SYS_READBIOS, do_readbios); /* read from BIOS locations */
/* Clock functionality. */
map(SYS_TIMES, do_times); /* get uptime and process times */
_PROTOTYPE( int do_vsafecopy, (message *m_ptr) );
_PROTOTYPE( int do_iopenable, (message *m_ptr) );
_PROTOTYPE( int do_setgrant, (message *m_ptr) );
+_PROTOTYPE( int do_readbios, (message *m_ptr) );
#endif /* SYSTEM_H */
$(SYSTEM)(do_getksig.o) \
$(SYSTEM)(do_endksig.o) \
$(SYSTEM)(do_kill.o) \
+ $(SYSTEM)(do_readbios.o) \
$(SYSTEM)(do_sigsend.o) \
$(SYSTEM)(do_sigreturn.o) \
$(SYSTEM)(do_abort.o) \
$(SYSTEM)(do_abort.o): do_abort.c
$(CC) do_abort.c
+$(SYSTEM)(do_readbios.o): do_readbios.c
+ $(CC) do_readbios.c
+
$(SYSTEM)(do_setgrant.o): do_setgrant.c
$(CC) do_setgrant.c
phys_bytes bytes; /* number of bytes to copy */
int i;
+ if (m_ptr->m_source != 0 && m_ptr->m_source != 1 &&
+ m_ptr->m_source != 2 && m_ptr->m_source != 3)
+ {
+ static int first=1;
+ if (first)
+ {
+ first= 0;
+ kprintf(
+"do_copy: got request from %d (source %d, seg %d, destination %d, seg %d)\n",
+ m_ptr->m_source,
+ m_ptr->CP_SRC_ENDPT,
+ m_ptr->CP_SRC_SPACE,
+ m_ptr->CP_DST_ENDPT,
+ m_ptr->CP_DST_SPACE);
+ }
+ }
+
/* Dismember the command message. */
vir_addr[_SRC_].proc_nr_e = m_ptr->CP_SRC_ENDPT;
vir_addr[_SRC_].segment = m_ptr->CP_SRC_SPACE;
--- /dev/null
+/* The kernel call implemented in this file:
+ * m_type: SYS_READBIOS
+ *
+ * The parameters for this kernel call are:
+ * m2_i1: RDB_SIZE number of bytes to copy
+ * m2_l1: RDB_ADDR absolute address in BIOS area
+ * m2_p1: RDB_BUF buffer address in requesting process
+ */
+
+#include "../system.h"
+#include <minix/type.h>
+
+/*===========================================================================*
+ * do_readbios *
+ *===========================================================================*/
+PUBLIC int do_readbios(m_ptr)
+register message *m_ptr; /* pointer to request message */
+{
+ int proc_nr;
+ struct proc *p;
+ phys_bytes address, phys_buf, phys_bios;
+ vir_bytes buf;
+ size_t size;
+
+ address = m_ptr->RDB_ADDR;
+ buf = (vir_bytes)m_ptr->RDB_BUF;
+ size = m_ptr->RDB_SIZE;
+
+ okendpt(m_ptr->m_source, &proc_nr);
+ p = proc_addr(proc_nr);
+ phys_buf = umap_local(p, D, buf, size);
+ if (phys_buf == 0)
+ return EFAULT;
+ phys_bios = umap_bios(p, address, size);
+ if (phys_bios == 0)
+ return EPERM;
+ phys_copy(phys_bios, phys_buf, size);
+ return 0;
+}
phys_bytes phys_buf;
int req_type, req_dir;
+ if ((m_ptr->DIO_REQUEST & _DIO_SAFEMASK) != _DIO_SAFE)
+ {
+ static int first= 1;
+ if (first)
+ {
+ first= 0;
+ kprintf("do_sdevio: for %d\n", m_ptr->m_source);
+ }
+ }
+
/* Check if process endpoint is OK.
* A driver may directly provide a pointer to a buffer at the user-process
* that initiated the device I/O. Kernel processes, of course, are denied.
int i,s;
struct vir_cp_req *req;
+ { static int first=1;
+ if (first)
+ {
+ first= 0;
+ kprintf("do_vcopy: got request from %d\n", m_ptr->m_source);
+ }
+ }
+
/* Check if request vector size is ok. */
nr_req = (unsigned) m_ptr->VCP_VEC_SIZE;
if (nr_req > VCOPY_VEC_SIZE) return(EINVAL);