Browse Source

Added debugging statements

tags/v0.9.3
Michael Brown 18 years ago
parent
commit
a6ba48e51e
1 changed files with 19 additions and 1 deletions
  1. 19
    1
      src/arch/i386/interface/pcbios/biosint.c

+ 19
- 1
src/arch/i386/interface/pcbios/biosint.c View File

37
 		.offset = handler,
37
 		.offset = handler,
38
 	};
38
 	};
39
 
39
 
40
+	DBG ( "Hooking INT %#02x to %04x:%04x\n",
41
+	      interrupt, rm_cs, handler );
42
+
40
 	if ( ( chain_vector->segment != 0 ) ||
43
 	if ( ( chain_vector->segment != 0 ) ||
41
 	     ( chain_vector->offset != 0 ) ) {
44
 	     ( chain_vector->offset != 0 ) ) {
42
 		/* Already hooked; do nothing */
45
 		/* Already hooked; do nothing */
46
+		DBG ( "...already hooked\n" );
43
 		return;
47
 		return;
44
 	}
48
 	}
49
+
45
 	copy_from_real ( chain_vector, 0, ( interrupt * 4 ),
50
 	copy_from_real ( chain_vector, 0, ( interrupt * 4 ),
46
 			 sizeof ( *chain_vector ) );
51
 			 sizeof ( *chain_vector ) );
52
+	DBG ( "...chaining to %04x:%04x\n",
53
+	      chain_vector->segment, chain_vector->offset );
54
+
47
 	copy_to_real ( 0, ( interrupt * 4 ), &vector, sizeof ( vector ) );
55
 	copy_to_real ( 0, ( interrupt * 4 ), &vector, sizeof ( vector ) );
48
 	hooked_bios_interrupts++;
56
 	hooked_bios_interrupts++;
49
 }
57
 }
65
 			    struct segoff *chain_vector ) {
73
 			    struct segoff *chain_vector ) {
66
 	struct segoff vector;
74
 	struct segoff vector;
67
 
75
 
76
+	DBG ( "Unhooking INT %#02x from %04x:%04x\n",
77
+	      interrupt, rm_cs, handler );
78
+
68
 	copy_from_real ( &vector, 0, ( interrupt * 4 ), sizeof ( vector ) );
79
 	copy_from_real ( &vector, 0, ( interrupt * 4 ), sizeof ( vector ) );
69
-	if ( ( vector.segment != rm_cs ) || ( vector.offset != handler ) )
80
+	if ( ( vector.segment != rm_cs ) || ( vector.offset != handler ) ) {
81
+		DBG ( "...cannot unhook; vector points to %04x:%04x\n",
82
+		      vector.segment, vector.offset );
70
 		return -EBUSY;
83
 		return -EBUSY;
84
+	}
85
+
86
+	DBG ( "...restoring to %04x:%04x\n",
87
+	      chain_vector->segment, chain_vector->offset );
71
 	copy_to_real ( 0, ( interrupt * 4 ), chain_vector,
88
 	copy_to_real ( 0, ( interrupt * 4 ), chain_vector,
72
 		       sizeof ( *chain_vector ) );
89
 		       sizeof ( *chain_vector ) );
90
+
73
 	chain_vector->segment = 0;
91
 	chain_vector->segment = 0;
74
 	chain_vector->offset = 0;
92
 	chain_vector->offset = 0;
75
 	hooked_bios_interrupts--;
93
 	hooked_bios_interrupts--;

Loading…
Cancel
Save