Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2000 02:26:26 +0000
From:      Tony Finch <dot@dotat.at>
To:        John Baldwin <jhb@FreeBSD.org>
Cc:        Michael Lucas <mwlucas@blackhelicopters.org>, mobile@FreeBSD.org
Subject:   Re: laptop recommendations
Message-ID:  <20001114022626.H25050@hand.dotat.at>
In-Reply-To: <XFMail.001110115245.jhb@FreeBSD.org>
References:  <20001110131753.A62744@blackhelicopters.org> <XFMail.001110115245.jhb@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
John Baldwin <jhb@FreeBSD.org> wrote:
>
>[Dell Inspiron 5000e] One known problem is that apm support won't
>work under FreeBSD because of a bug in the BIOS. :-(

Is this the same as the bug in the Latitude CPx that locks up the
machine when suspending from X? I have a work-around for that.

Tony.
-- 
en oeccget g mtcaa    f.a.n.finch
v spdlkishrhtewe y    dot@dotat.at
eatp o v eiti i d.    fanf@covalent.net


/*
 * zzz.c: a wrapper around apm(8) that works on my dodgy laptop
 *
 * (C) 2000 Tony Finch <dot@dotat.at>
 */

static const char *const cvsid =
"$Header: /cvs/fanf/zzz/zzz.c,v 1.1.1.1 2000/06/22 08:43:37 fanf Exp $";

#include <sys/ioctl.h>
#include <sys/types.h>
#include <sys/wait.h>

#include <machine/console.h>

#include <unistd.h>
#include <fcntl.h>
#include <err.h>

int main() {
	int fd, vt, status;

	fd = open("/dev/vga", O_RDONLY);
	if(fd < 0) err(1, "open /dev/vga");
	if(ioctl(fd, VT_GETACTIVE, &vt) < 0)
		err(1, "ioctl VT_GETACTIVE");
	if(ioctl(fd, VT_ACTIVATE, 1) < 0)
		err(1, "ioctl VT_ACTIVATE");
	switch(fork()) {
	case -1:
		err(1, "fork");
	case 0:
		execl("/usr/sbin/apm", "apm", "-z", NULL);
		err(1, "exec apm -z");
	default:
		wait(&status);
		if(!WIFEXITED(status) || WEXITSTATUS(status))
			errx(1, "apm -z failed");
	}
	sleep(3);
	if(ioctl(fd, VT_ACTIVATE, vt) < 0)
		err(1, "ioctl VT_ACTIVATE");
	exit(0);
}


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001114022626.H25050>