depend:
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
+ cd ramdisk && make depend
# Include generated dependencies.
include .depend
# Makefile for ramdisk image
PROGRAMS=at_wini bios_wini cdprobe dev2name floppy loadramdisk newroot \
- sh service sysenv
+ pci sh service sysenv
all: image.c
../../floppy/floppy:
cd ../../floppy && make
+pci: ../../pci/pci
+ install -s ../../$@/$@ $@
+
+../../pci/pci:
+ cd ../../pci && make
+
cdprobe: ../../../commands/simple/cdprobe
install -s ../../../commands/simple/$@ $@
../../../servers/rs/service:
cd ../../../servers/rs && make service
+depend:
+ /usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
+
+# Include generated dependencies.
+include .depend
+
boot
-200 100
+240 100
d--755 0 0
bin d--755 0 0
at_wini ---755 0 0 at_wini
floppy ---755 0 0 floppy
loadramdisk ---755 0 0 loadramdisk
newroot ---755 0 0 newroot
+ pci ---755 0 0 pci
sh ---755 0 0 sh
service ---755 0 0 service
sysenv ---755 0 0 sysenv
#!/bin/sh
set -e
+/bin/service up /bin/pci
/bin/service up /bin/floppy -dev /dev/fd0
if [ X`/bin/sysenv bios_wini` = Xyes ]
then
#define LOG_PROC_NR 4 /* log device driver */
#define TTY_PROC_NR 5 /* terminal (TTY) driver */
#define DS_PROC_NR 6 /* data store server */
-#define PCI_PROC_NR 7 /* driver for PCI controllers */
-#define INIT_PROC_NR 8 /* init -- goes multiuser */
+#define INIT_PROC_NR 7 /* init -- goes multiuser */
/* Number of processes contained in the system image. */
#define NR_BOOT_PROCS (NR_TASKS + INIT_PROC_NR + 1)
{ LOG_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M, DRV_C, "log" },
#if 0
{ DRVR_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M, DRV_C, "driver"},
-#endif
{ PCI_PROC_NR, 0, SRV_F, 4, 2, 0, SRV_T, SYS_M, PCI_C, "pci"},
+#endif
{ INIT_PROC_NR, 0, USR_F, 8, USER_Q, 0, USR_T, USR_M, 0, "init" },
};
--- /dev/null
+extern int pci_procnr;
pci_attr_r16.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m2_i1= devind;
m.m2_i2= port;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_attr_r16: can't talk to PCI", r);
pci_attr_r32.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m2_i1= devind;
m.m2_i2= port;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_attr_r32: can't talk to PCI", r);
pci_attr_r8.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m2_i1= devind;
m.m2_i2= port;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_attr_r8: can't talk to PCI", r);
pci_attr_w16.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m2_i2= port;
m.m2_l1= value;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_attr_w16: can't talk to PCI", r);
pci_attr_w32.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m2_i2= port;
m.m2_l1= value;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_attr_w32: can't talk to PCI", r);
pci_attr_w8.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m2_i2= port;
m.m2_l1= value;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_attr_w8: can't talk to PCI", r);
pci_dev_name.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m1_i3= sizeof(name);
m.m1_p1= name;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_dev_name: can't talk to PCI", r);
pci_find_dev.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m1_i2= dev;
m.m1_i3= func;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_find_dev: can't talk to PCI", r);
pci_first_dev.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
message m;
m.m_type= BUSC_PCI_FIRST_DEV;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_first_dev: can't talk to PCI", r);
if (m.m_type == 1)
pci_ids.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m_type= BUSC_PCI_IDS;
m.m1_i1= devind;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_ids: can't talk to PCI", r);
pci_init1.c
*/
+#include "pci.h"
#include "syslib.h"
#include <string.h>
+#include <unistd.h>
#include <minix/sysutil.h>
+int pci_procnr= ANY;
+
/*===========================================================================*
* pci_init1 *
*===========================================================================*/
size_t len;
message m;
+ r= findproc("pci", &pci_procnr);
+ if (r != 0)
+ panic("pci", "pci_init1: findproc failed for 'pci'", r);
+ printf("'pci' is at %d\n", pci_procnr);
+
m.m_type= BUSC_PCI_INIT;
len= strlen(name);
if (len+1 <= sizeof(m.m3_ca1))
memcpy(m.m3_ca1, name, len);
m.m3_ca1[len]= '\0';
}
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_init1: can't talk to PCI", r);
if (m.m_type != 0)
pci_next_dev.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m_type= BUSC_PCI_NEXT_DEV;
m.m1_i1= *devindp;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_next_dev: can't talk to PCI", r);
pci_rescan_bus.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m_type= BUSC_PCI_RESCAN;
m.m1_i1= busnr;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_rescan_bus: can't talk to PCI", r);
pci_reserve.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m_type= BUSC_PCI_RESERVE;
m.m1_i1= devind;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_reserve: can't talk to PCI", r);
pci_slot_name.c
*/
+#include "pci.h"
#include "syslib.h"
#include <minix/sysutil.h>
m.m1_i2= sizeof(name);
m.m1_p1= name;
- r= sendrec(PCI_PROC_NR, &m);
+ r= sendrec(pci_procnr, &m);
if (r != 0)
panic("pci", "pci_slot_name: can't talk to PCI", r);
../drivers/tty/tty \
../drivers/memory/memory \
../drivers/log/log \
- ../drivers/pci/pci \
../servers/init/init
usage: