Title: JTAG
1???????????? ????????????? ? ???????????? ?
?????????? ?????????????? ???????????? 2
??????? ????, ??????????? ??????????????
?????????? ?.?.?. ???????? ???????? ???????????
2?????????? ??????
- ?????????? ?? ??????? ???????
- ?????????? ???????????
- ??????????? ???????????
- ?????? ??????????? ??????????
- ???? ?????????? ? ???? ??????? ?????????
3??????? ????????? (??? ??????????? ???????)
- ?????????? ?? ?????????? ???????
- ???????? ?????????? ???????? ??????? ?????????
- ??????????? ?? ???????
- ??????????? ? ?????????? ???????????
4?????????? ???????????
- ?????????? ? ?????????? ???. ????.
- ?????????? ???????? ??????????
- JTAG
- ????????????? ???????
- ??????????? (????????) ???????????
- ?????????? ??????????
- ??????????????????
- ??????????? ????????????? ??????????
5?????????? ???????? ?? x86
- 6 ????????? DR0-DR3,DR6,DR7
- ????? ???????? (4 ??.)
- ?? ??????
- ?? ?????? ? ??????
- ?? ??????????
- ?? ????????? ? ????? ?????-??????.
- ?????? ?????? ??????? ?? ????????? ???????
6?????????? ?????????? ???????? (JTAG Joint Test
Action Group)
- ????? ??????????? ?????? ? ??????? ??
(??????????? ??????? ?? ???? ??) - ?????????? ????? ??????? ?? ?????????? JTAG
- ??????????? ????????? ????? ????? ??????? ??,
????????????? ???????? ???????? ?? ???????????
?????? - ?????????? ???????????????? ? ????? ???????
????? ????????, ???????? ? ?????? ?????????
7????????????? ???????????
- ??????????
- ??????????? ???????????
- ??????????? ? ?????????? ???????
- ?????? 1-4 ??????
- ??????????? ? ?????? ?????????
- ???????? ??????? ?????????
- ?????????? ??????????
- ???????? ??????
- ???????-????? ???????
- ??????? ??????? ??????? ? ????????? ???????????
8?????? ?????????
- ?????????? ????????? ????????? (?????????)
(???????-?????) - ???? ????? ?????????? ????? ??? ??????? ?????
????? ?????????? (???? ?????????? ??? ?????????
?????) - ? ?????? ?????? ??????? ???????? ???????? ??????
????? ????????? - ????????? ????????? ??? ????????? ??????????
- ??????????????? ?????????, ????????????? ?
???????????? ??????????????
9??????????? ????
Ethernet, USB, LPT
VME, PCI, PCI-Express ? ?.?.
x86-windows
???. ?????
?? ??????????? ? ??????????
- ??????-??
- Silicon Control Inc
- Curtiss-Wright Electronics systems (???. VMETRO)
- LeCroy Inc
- Tektronix Inc
10????????? ??????????? ????
- ??????? ?????? ? ????????? ???????????
- ??? ?????????????? (??????)
- ??? ??????????
11??? 1 ??????? ???????
12??? 2 ????????? ?????????
13????? ??????? ??? ???????????
- ??????????? ???????
- ??????????? ????????
- ????? ????????? ????????
- ??????? ?????? ???????????
- ??????? ?????? ??????? (??????)
14????? ??????? ??? ??????????? (2)
15????? ??????? (3)
- ???????????? ???????
- ??????? ?? ????????? ????? ???????? ???? (, lt,
gt, ?? .. ??) - ???????????? ????? ??????? (8, 32)
- ????????? ??? ????????? (?, ???, ??)
- ???????? ??????? (8 ?????????)
- ??????? ???????? ? ????? ?????????
- ??? ??????????, ???????? ? ?????? ?????????
- ?????????? ?? ???????
- ????????? ???????? ???????????? ??????
16?????????? ????????? ????????????
- ?????????
- ????????? ?????????? ???????
- ?????? ?? ??????? ???????? ????
- ????? ?? ??????? ???????? ????
- ?????????? ??????
- ????????? ?????
- ??????????? ?????????? (API)
17?????? ??????????????????
- ?????????????
- BusBusy, BusIdle, DataPhase, WaitState
- ?????????? ???????????
- ??? ??????, ??? ?? ???????????
- ?? ?????????? ???????
- ????????????
- Master ?? ??????????? ?????? ?? ??????? ?????
?????? - Target ?? ??????? ??????? ????? ?????? ??
??????????? - Arbitration ?? ??????? ?? ??????????
18???????? ???????? ????
- ????????? (master)
- ?????, ?????
- ????? (?????????, ????????)
- ??????, ??????, ?????? ? ?????????
- ??????????? ?????????? (target)
- ???????? ???????
- ????? ?????? ????????
- ????? (OK, retry, fail)
- ????????????? ??????
- ???????? ? ??????????
19???????? ????????? ????
20??????????? ??????????? ??????? ????????????
???????
- ??????????? ????????? ???????
- strace /bin/cat
// ???????????? ???????? open("/lib/i386-linux-gnu
/libc.so.6", O_RDONLYO_CLOEXEC) 3read(3,
"\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\000
0\226\1\0004\0\0\0"..., 512) 512fstat64(3,
st_modeS_IFREG0755, st_size1734120, ...)
0mmap2(NULL, 1743580, PROT_READPROT_EXEC,
MAP_PRIVATEMAP_DENYWRITE, 3, 0)
0xb75a0000mmap2(0xb7744000, 12288,
PROT_READPROT_WRITE, MAP_PRIVATEMAP_FIXEDMAP_DE
NYWRITE, 3, 0x1a4) 0xb7744000mmap2(0xb7747000,
10972, PROT_READPROT_WRITE, MAP_PRIVATEMAP_FIXED
MAP_ANONYMOUS, -1, 0) 0xb7747000close(3)
0
21????? strace(2)
- read(0, "fkjdfkjfd\n", 32768)
10write(1, "fkjdfkjfd\n", 10)
10read(0, "sdcdscdsv\n", 32768)
10write(1, "sdcdscdsv\n", 10)
10read(0, "fbfb\n", 32768)
5write(1, "fbfb\n", 5)
5read(0, "", 32768)
0close(0)
0close(1)
0close(2)
0exit_group(0) ?
22??????????? ???????????? ???????
- ltrace /bin/cat 2gt ltrace.out
__libc_start_main(0x8049280, 1, 0xbfb66534,
0x80500d0, 0x8050140 ltunfinished
...gtgetpagesize()
4096strrchr("/bin/cat", '/')
"/cat"setlocale(6, "")
"en_US.UTF-8"bindtextdomain("coreutils",
"/usr/share/locale") "/usr/share/locale"
textdomain("coreutils")
"coreutils"__cxa_atexit(0x804a2f0, 0, 0,
0xb7769ff4, 0) 0getopt_long(1,
0xbfb66534, "benstuvAET", 0x08050840, NULL)
-1__fxstat64(3, 1, 0xbfb6641c)
0__fxstat64(3, 0, 0xbfb6641c)
0
23??????????? ???????????? ??????? (2)
posix_fadvise64(0, 0, 0, 0, 0)
0malloc(36863)
0x097e0890read(0, "qwerty\n", 32768)
7write(1, "qwerty\n", 7)
7read(0, "", 32768)
0free(0x097e0890)
ltvoidgtclose(0)
0exit(0 ltunfinished ...gt
24????? ? ???????????? ???????
include lttime.hgt struct timespec time_t
tv_sec int tv_usec // ????
struct tm time() sleep()
25????????? ??????? ? ?? (2)
- /usr/bin/time myfile
- real
- user
- sys
- ??????? rdtsc ? x86 ????? ?????? ?? ? ???????
???????
26?????????????? ???????? gprof
- gcc pg a.c
- a.out (????????? gmon.out)
- gprof
- ??????? 100 ??? ? ???????
- ????? ??????? ???????
- ?????, ??????????? ? ?????? ???????
- ???? ???????
27valgrind
- valgrind myfile
- valgrind -- toolcachegrind myfile
- ???????? ????????? ??????? ???????????? ?????? ?
??????????? ? malloc/free - ?????? ?????? ?????????????? ???-??????
- ?????????? ????? ??????? ???????
- ??????????? ?????????? ????????????
- www.valgrind.org
28???????????? ?????? 1
- ????????? ??????? ?????????? ????????? (???? b.c)
- ???????????
- ??????? time
- rdtsc (??? ????????? asm ? ???)
- ????????? ????? ????????? ???
- ??? ????????? ??????? ????????????
- ????????? ??????? ?????? ???????. ??????
?????????? ?????? - ?????????? ?????? ?????? ??????????? ???????????
29????????? ??? ?????? ??????? ??????????
include ltstdio.hgtdefine SIZE 10000float
aSIZESIZEvoid main( int argc, char argv
)float b int i,k b0 for( i 0 i lt
SIZE i ) for( k 0 k lt SIZE k )
b b aik
30???????? ???????
- ????? ????? ?????? ????????? ?????????????
?????????????? ??????? - ??????????, ??? ??????????? ????????? ???? ??
???????? ??????????? - ??????????
- ????????? ????????, ??? ?????????? ? ???????