Skip to contentSkip to conversation

Interrupt testing

PATCH phcoder 2 participants 3 messages Mar 7, 2009 – Aug 28, 2009

lore
Share & tools
lore

phcoder

author
#0 lore raw

Hello. Here is a trivial patch for testing which interrupts are and which aren't handled by BIOS. Can be used as a simple but not reliable test for boot viruses

Signature · 2 lines
Regards
Vladimir 'phcoder' Serbinenko
i386-pc.rmk +0 -0
Index: conf/i386-pc.rmk
===================================================================
@@ -172,3 +181,3 @@
 	vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod	\
 	ata.mod vga.mod memdisk.mod pci.mod lspci.mod \
 	aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \
	datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \

- usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod
+ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \
+ inttest.mod

+# For inttest.mod.
+inttest_mod_SOURCES = commands/i386/pc/inttest.c
+inttest_mod_CFLAGS = $(COMMON_CFLAGS) -Werror
+inttest_mod_LDFLAGS = $(COMMON_LDFLAGS)

ChangeLog +7 -0
Index: ChangeLog
===================================================================
@@ -1,3 +1,10 @@
+2009-03-07  Vladimir Serbinenko  <[email protected]>
+
+	Interrupt tests
+	
+	* commands/i386/pc/inttest.c: new file
+	* conf/i386-pc.rmk: new module inttest.mod
+
 2009-03-07  Bean  <[email protected]>
 
 	* loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd
i386/pc/inttest.c +85 -0

85 lines not on this page · raw message

#1 lore raw
Quoted 3 lines · phcoder

Hello. Here is a trivial patch for testing which interrupts are and which aren't handled by BIOS. Can be used as a simple but not reliable test for boot viruses

Would it be feasible to make this more generic? BIOS works with 16-bit 8086 mode interrupt handlers, others might have setup 32-bit interrupt handlers.

What would you think of:

- Detect both 16-bit / 8086 interrupts and 32-bit ones.
- Make it agnostic about what firmware instead of assuming BIOS.
- Building it in i386.rmk instead.

?

Signature · 5 lines
Robert Millan

  The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and
  how) you may access your data; but nobody's threatening your freedom: we
  still allow you to remove your data and not access it at all."
#2 lore raw
Quoted 5 lines · Robert Millan
Quoted 3 lines · phcoder

Hello. Here is a trivial patch for testing which interrupts are and which aren't handled by BIOS. Can be used as a simple but not reliable test for boot viruses

Quoted 9 lines

Would it be feasible to make this more generic?  BIOS works with 16-bit 8086 mode interrupt handlers, others might have setup 32-bit interrupt handlers.

What would you think of:

 - Detect both 16-bit / 8086 interrupts and 32-bit ones.
 - Make it agnostic about what firmware instead of assuming BIOS.
 - Building it in i386.rmk instead.

I don't know if it's possible. Any interrupt handler would also intercept mmap interrupts so checking against memory map is useless. The problem is to know which parts of memory are ROM and which ones are RAM. I think what you propose is possible but I don't know how to do it. The main idea behind this checker is to check for simple boot viruses (not advanced ones) and the main target for boot viruses is BIOS (even if EFI would be excellent for virus writers)

Quoted 15 lines

 ?

--
Robert Millan

 The DRM opt-in fallacy: "Your data belongs to us. We will decide when (and how) you may access your data; but nobody's threatening your freedom: we still allow you to remove your data and not access it at all."

_______________________________________________
Grub-devel mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/grub-devel

Signature · 4 lines
Regards
Vladimir 'phcoder' Serbinenko

Personal git repository: http://repo.or.cz/w/grub2/phcoder.git