http://www.perlmonks.org?node_id=917363

alexanderp98 has asked for the wisdom of the Perl Monks concerning the following question:

Is it possible to make BIOS calls using perl?

Replies are listed 'Best First'.
Re: BIOS calls?
by ikegami (Pope) on Jul 28, 2011 at 23:22 UTC

    Perl does not provide the means of to make interrupt calls. A module could provide this functionality, but I didn't find one doing a quick search of CPAN.

    Well, there is Inline::ASM.

Re: BIOS calls?
by Khen1950fx (Canon) on Jul 29, 2011 at 05:14 UTC
    On my system, interrupt calls to the BIOS aren't possible, but there are ways to get information about the BIOS. Here's a script that I use to get BIOS and boot info. It requires Parse::DMIDecode and Linux::Bootloader.
    #!/usr/bin/perl use strict; use warnings; use Parse::DMIDecode qw(@TYPES %GROUPS); use Data::Dumper::Concise; use Linux::Bootloader; my $dmi = Parse::DMIDecode->new( dmidecode => "/usr/sbin/dmidecode", nowarnings => 1, ); $dmi->probe; print $dmi->keyword("bios-address"), "\n", Dumper($dmi->keyword("bios-characteristics")), "\n", Dumper($dmi->keyword("bios-currently-installed-language")), "\n" +, Dumper($dmi->keyword("bios-installable-languages")), "\n", $dmi->keyword("bios-release-date"), "\n", $dmi->keyword("bios-rom-size"), "\n", $dmi->keyword("bios-runtime-size"), "\n", $dmi->keyword("bios-vendor"), "\n", $dmi->keyword("bios-version"), "\n"; my $bootloader = new Linux::Bootloader(); my $config_file = '/boot/grub/grub.conf'; $bootloader->read($config_file); $bootloader->print_info('all');
    For those of you using Windows, you'll find something similar here.
Re: BIOS calls?
by ww (Archbishop) on Jul 28, 2011 at 23:15 UTC
    Did you bother to do any research of your own?

    You could improve your question greatly if you were to tell us what you want to do... and what you've tried, to achieve it.

      Yes I did research and couldn't find anything. I want to be able to issue PCI related BIOS calls as well as issue SCSI commands if possible under windows to test drives as well as HBAs.
Re: BIOS calls?
by sundialsvc4 (Abbot) on Jul 29, 2011 at 12:08 UTC

    User-mode programs (including all programs written in Perl) do not have direct access to the hardware.   But the operating system does, and should you be unfortunate enough to still be using a system that has a “BIOS,” (only) the OS can make the calls.

      should you be unfortunate enough to still be using a system that has a “BIOS,”

      unfortunate to be using a modern computer?

      Why do you say such ridiculous things?

        He's referring to Apple hardware that uses Extensible Firmware Interface, or perhaps to Sun (now Oracle) hardware that uses Open Firmware. It's only Intel PC type motherboards that use a BIOS (and he's right, it's old crufty technology, but it does have the weight of inertia and a gigantic installed base).

Re: BIOS calls?
by planetscape (Chancellor) on Jul 30, 2011 at 12:40 UTC