Wednesday, 15 April 2015

gcc - Printing Error line number, file, and registers in linux operating system? -


We are building operating systems such as Linux with nothing in the most dangerous course in our school. We make it on X86 processor IA32 architecture, and use PIC-8259. Anyway, we have finished setting GDT, PIC, IDT, and paging at one point that we are able to obtain and print 19 exceptions in the following Linux;

  void divide_by_zero (void) {Printf ("Exception 0: -You divided by zero"); (1) {} will be closed later}  

The above exception function only prints the message, I want to extend it so that it can print file and line number error Well, like GCC does when you compile, I want to print the general purpose register and flag even if possible, if possible, edx, ecco, ds, ss etc. I'm stuck, I do not know how I can get a line number / reached the above function. We have many files compiled by Mayfile, and some errors such as paging errors do not appear, if they do, they are only warnings


No comments:

Post a Comment