Improved Linux bootstrap tooling base

This commit is contained in:
Jeremiah Orians 2016-10-02 13:26:05 -04:00
parent aae9ed7a80
commit 6383c9a5a0
No known key found for this signature in database
GPG Key ID: 7457821534D2ACCD
4 changed files with 27 additions and 0 deletions

View File

@ -1,7 +1,9 @@
* Unreleased
** Added
+ Created xeh tool in C for more cross platform debugging
** Changed
+ Renamed xeh1 files to match current naming standard
** Fixed

25
Linux Bootstrap/xeh.c Normal file
View File

@ -0,0 +1,25 @@
#include<stdlib.h>
int main (int argc, char *argv[])
{
char output[2] = {};
char table[16] = {0x30, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x38, 0x39, 0x41, 0x42, 0x43, 0x44, 0x45, 0x46};
char c;
int col = 40;
int i = read(0, &c, 1);
while( i > 0)
{
output[0] = table[c / 16];
output[1] = table[c % 16];
write(1, output, 2 );
col = col - 2;
if(0 == col)
{
col = 40;
write(1, "\n", 1);
}
i = read(0, &c, 1);
}
write(1, "\n", 1);
exit(EXIT_SUCCESS);
}