Moved PCI driver to the ramdisk.
This commit is contained in:
parent
1116853ae9
commit
7034c0795d
23 changed files with 58 additions and 21 deletions
|
@ -48,6 +48,7 @@ clean:
|
|||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c ../libdriver/*.c > .depend
|
||||
cd ramdisk && make depend
|
||||
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Makefile for ramdisk image
|
||||
|
||||
PROGRAMS=at_wini bios_wini cdprobe dev2name floppy loadramdisk newroot \
|
||||
sh service sysenv
|
||||
pci sh service sysenv
|
||||
|
||||
all: image.c
|
||||
|
||||
|
@ -37,6 +37,12 @@ floppy: ../../floppy/floppy
|
|||
../../floppy/floppy:
|
||||
cd ../../floppy && make
|
||||
|
||||
pci: ../../pci/pci
|
||||
install -s ../../$@/$@ $@
|
||||
|
||||
../../pci/pci:
|
||||
cd ../../pci && make
|
||||
|
||||
cdprobe: ../../../commands/simple/cdprobe
|
||||
install -s ../../../commands/simple/$@ $@
|
||||
|
||||
|
@ -79,3 +85,9 @@ service: ../../../servers/rs/service
|
|||
../../../servers/rs/service:
|
||||
cd ../../../servers/rs && make service
|
||||
|
||||
depend:
|
||||
/usr/bin/mkdep "$(CC) -E $(CPPFLAGS)" *.c > .depend
|
||||
|
||||
# Include generated dependencies.
|
||||
include .depend
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
boot
|
||||
200 100
|
||||
240 100
|
||||
d--755 0 0
|
||||
bin d--755 0 0
|
||||
at_wini ---755 0 0 at_wini
|
||||
|
@ -9,6 +9,7 @@ d--755 0 0
|
|||
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
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#!/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
|
||||
|
|
|
@ -38,8 +38,7 @@
|
|||
#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)
|
||||
|
|
|
@ -109,8 +109,8 @@ PUBLIC struct boot_image image[] = {
|
|||
{ 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" },
|
||||
};
|
||||
|
||||
|
|
1
lib/syslib/pci.h
Normal file
1
lib/syslib/pci.h
Normal file
|
@ -0,0 +1 @@
|
|||
extern int pci_procnr;
|
|
@ -2,6 +2,7 @@
|
|||
pci_attr_r16.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ int port;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_attr_r32.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ int port;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_attr_r8.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ int port;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_attr_w16.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -21,7 +22,7 @@ u16_t value;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_attr_w32.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -21,7 +22,7 @@ u32_t value;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_attr_w8.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -21,7 +22,7 @@ u8_t value;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_dev_name.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -23,7 +24,7 @@ u16_t did;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_find_dev.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -22,7 +23,7 @@ int *devindp;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_first_dev.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -17,7 +18,7 @@ u16_t *didp;
|
|||
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)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_ids.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ u16_t *didp;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,10 +2,14 @@
|
|||
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 *
|
||||
*===========================================================================*/
|
||||
|
@ -16,6 +20,11 @@ char *name;
|
|||
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))
|
||||
|
@ -26,7 +35,7 @@ char *name;
|
|||
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)
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_next_dev.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -19,7 +20,7 @@ u16_t *didp;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_rescan_bus.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -17,7 +18,7 @@ u8_t busnr;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_reserve.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -17,7 +18,7 @@ int devind;
|
|||
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);
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
pci_slot_name.c
|
||||
*/
|
||||
|
||||
#include "pci.h"
|
||||
#include "syslib.h"
|
||||
#include <minix/sysutil.h>
|
||||
|
||||
|
@ -21,7 +22,7 @@ int devind;
|
|||
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);
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@ PROGRAMS= ../kernel/kernel \
|
|||
../drivers/tty/tty \
|
||||
../drivers/memory/memory \
|
||||
../drivers/log/log \
|
||||
../drivers/pci/pci \
|
||||
../servers/init/init
|
||||
|
||||
usage:
|
||||
|
|
Loading…
Reference in a new issue