Skip to content

Commit

Permalink
ACPI driver loaded at boot time
Browse files Browse the repository at this point in the history
- the acpi driver is part of the ramdisk and if present the rc script
  starts it before pci is started as pci needs if APIC mode is turned
  on.
  • Loading branch information
Tomas Hruby committed Sep 2, 2010
1 parent 9560b6d commit 7ae6f87
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 4 deletions.
16 changes: 14 additions & 2 deletions drivers/ramdisk/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

PROGRAMS=ahci at_wini bios_wini cdprobe dev2name floppy loadramdisk mount \
newroot pci sh service sysenv mfs ext2

# acpi is not compiled with ack
.if ${COMPILER_TYPE} == "gnu"
PROGRAMS += acpi
.endif

EXTRA=system.conf passwd rs.single

CPPFLAGS+= -I${MINIXSRCDIR}/servers -I${MINIXSRCDIR}
Expand All @@ -22,7 +28,7 @@ image.c: bintoc image
bintoc: bintoc.c
$(CC) -o $@ bintoc.c

image: proto.gen mtab rc $(PROGRAMS) $(EXTRA)
image: proto.gen mtab rc $(EXTRA)
mkfs.mfs image proto.gen || { rm -f image; false; }

ahci: ../ahci/ahci
Expand All @@ -49,6 +55,12 @@ floppy: ../floppy/floppy
../floppy/floppy:
$(MAKE) -C ../floppy

acpi: ../acpi/acpi
install -s ../$@/$@ $@

../acpi/acpi:
$(MAKE) -C ../acpi

pci: ../pci/pci
install -s ../$@/$@ $@

Expand Down Expand Up @@ -124,7 +136,7 @@ passwd: ../../etc/passwd
rs.single: ../../etc/rs.single
install -s ../../etc/$@ $@

proto.gen: $(MAKEDEV) proto.sh proto
proto.gen: $(PROGRAMS) $(MAKEDEV) proto.sh proto
sh -e proto.sh >proto.gen

.include <bsd.prog.mk>
3 changes: 2 additions & 1 deletion drivers/ramdisk/proto
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
boot
320 440
420 440
d--755 0 0
bin d--755 0 0
cdprobe ---755 0 0 cdprobe
Expand All @@ -12,6 +12,7 @@ d--755 0 0
sysenv ---755 0 0 sysenv
$
sbin d--755 0 0
@ACPI@
ahci ---755 0 0 ahci
at_wini ---755 0 0 at_wini
bios_wini ---755 0 0 bios_wini
Expand Down
7 changes: 6 additions & 1 deletion drivers/ramdisk/proto.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
#!/bin/sh
PATH=/bin:/sbin:/usr/bin:/usr/sbin
sed -n '1,/@DEV/p' <proto | grep -v @DEV@
sed -n '1,/@ACPI/p' <proto | grep -v @ACPI@
if [ -e acpi ]
then
echo " acpi ---755 0 0 acpi"
fi
sed -n '/@ACPI/,/@DEV/p' <proto | grep -v -e @ACPI@ -e @DEV@
(
cd /dev
ls -aln | grep '^[bc]' | egrep -v ' (fd1|fd0p|tcp|eth|ip|udp|tty[pq]|pty)' | grep -v 13, | \
Expand Down
4 changes: 4 additions & 0 deletions drivers/ramdisk/rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ exec >/dev/log
exec 2>/dev/log
exec </dev/null

if [ -e /sbin/acpi ]
then
/bin/service -c up /sbin/acpi
fi
/bin/service -c up /sbin/pci
/bin/service -cn up /sbin/floppy -dev /dev/fd0
if [ X`/bin/sysenv bios_wini` = Xyes ]
Expand Down
10 changes: 10 additions & 0 deletions etc/system.conf
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,16 @@ service is
uid 0;
};

service acpi
{
io ALL;
system
PRIVCTL # 4
DEVIO # 21
;
uid 0;
};

service pci
{
io cf8:8 # PCI bus controller
Expand Down

0 comments on commit 7ae6f87

Please sign in to comment.