Posted: . At: 6:05 AM. This was 13 years ago. Post ID: 1120
Page permalink. WordPress uses cookies, or tiny pieces of information stored on your computer, to verify who you are. There are cookies for logged in users and for commenters.
These cookies expire two weeks after they are set.

FreeBSD still going well.

My installation of FreeBSD 8.2 is still going very well indeed, I am have installed Eterm, so that I can set a wallpaper with Esetroot and I am playing mp3 music right now with xmms whilst I write this post. The bug in Linux where the headphone audio is muted and inaudible on a laptop despite the fact that when the headphones are unplugged the sound from the speakers is fine still exists in Fedora Core 13 and Ubuntu 10.10. But when the headphones are plugged into the offending laptop running FreeBSD 8.2 the headphone sound works perfectly. It must be an alsa sound issue and not a kernel issue, it works perfectly with FreeBSD and of course Windows XP, so why does it not work with Linux? I am using the OSS sound system not alsa on BSD and I did not even need to use the mixer program before playing music, it just worked. Very good indeed, FreeBSD will be a very good desktop OS at this rate. With a very good default kernel and increasing hardware support it is a good choice for running on a laptop as it does not take up as much memory as Ubuntu or Linux Mint do. Those two distributions are getting very bloated and need to trim back on the extras they are including. I am wanting to get my little sysinfo program working on FreeBSD but it did not include syscall.h and I need to find an equivalent to get this code to work.

#include <unistd.h> /* for _syscallX macros/related stuff */
#include <syscall.h>
#include <sys/utsname.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
 
#include "sysinfo.h"
#include "strings.h"
 
int main(int argc, char **argv)
{
	struct utsname uname_pointer;
 
	printf("-Currently logged in user: \n");
	system("who am i");
	printf("\n-Kernel information. \n");
 
	uname(&uname_pointer);
	if (strlen(uname_pointer.domainname) < 7 or
	    strncmp(uname_pointer.domainname, "(none)", 10) == 0) {
		printf("--System name - %s \n"		\
			"--Nodename    - %s \n"		\
			"--Release     - %s \n"		\
			"--Version     - %s \n"		\
			"--Machine     - %s \n\n",
			uname_pointer.sysname,
			uname_pointer.nodename,
			uname_pointer.release,
			uname_pointer.version,
			uname_pointer.machine
			);
	} else {
		printf("--System name - %s \n"		\
			"--Nodename    - %s \n"		\
			"--Release     - %s \n"		\
			"--Version     - %s \n"		\
			"--Machine     - %s \n"		\
			"--Domain Name - %s \n\n",
			uname_pointer.sysname,
			uname_pointer.nodename,
			uname_pointer.release,
			uname_pointer.version,
			uname_pointer.machine,
			uname_pointer.domainname
		);
	}
 
	printf("-Ram & swap information: \n");
	kernel("/proc/swaps", 2);
	printf("-Uptime: \n");
	system("uptime");
 
	if (argc > 1 and strncmp(argv[1], "3", BUF) == 0) {
		printf("\t\tCdrom drive information.\n");
		kernel("/proc/sys/dev/cdrom/info", 5);
	}
 
	if (argc > 1 and strncmp(argv[1], "4", BUF) == 0) {
		printf("\t\tSound Card information.\n");
		kernel("/proc/asound/cards", 4);
		printf("\t\tSCSI device information.\n");
		kernel("/proc/scsi/scsi", 2);
	}
 
	if (argc > 1 and strncmp(argv[1], "5", BUF) == 0) {
		printf("\t\tReal Time Clock information.\n");
		kernel("/proc/driver/rtc", 3);
	}
 
	if (argc > 1 and strncmp(argv[1], "6", BUF) == 0) {
		printf("\t\tInput devices information.\n");
		kernel("/proc/bus/input/devices", 4);
	}
 
	return 0;
}

But I am sure that there is a way to do this I just need to do some more research.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.