tpm php,TPM系列

近来一直在整理资料,刚好看到有比较详细的介绍,就发扬一下“拿来主义”吧:)顺便鄙视一下某安全网站转载我的博客很乱:(

1、安装环境准备

1.1内核

Linux内核2.6.12版本及以上,提供了对tpm芯片的支持,下载地址:。

1.2算法库支持

Gmplib库,提供一些密码学算法的支持,下载地址:。

1.3 Tpm_emulator软件

Tpm_emulator模拟tpm芯片,相当于一个虚拟的芯片,目前最高版本0.5.1,下载地址:https://developer.berlios.de/project/showfiles.php?group_id=2491

1.4 Tss软件栈

Tss软件栈包括Trousers、grub-ima、openssl tpm engine、tpm keyring、tpm-tools,trousers软件包提供一些tpm的API函数,这里只安装trousers软件包,下载地址:

Trousers安装所需环境:

软件要求: 版本查看命令:

automake > 1.4   automake --version

autoconf > 1.4 autoconf --version

Pkgconfig pkg-config --version

Libtool rpm -qa | grep libtool

gtk2-devel pkg-config --list-all |grep gtk (查看是否安装了gtk)

openssl-devel >= 0.9.8 openssl version -a//redhat as4.7 的openssl版本 为0.9.7a

安装openssl-0.9.8以及它所依赖的glibc2.4软件下载地址: ?

安装、卸载命令:rpm -ivh/-e --enforce --nodeps XXXX

2、软件安装

2.1内核安装

#make menuconfig

在内核配置文件中选中如下参数即可将TPM驱动编入内核。

Device Driver->

Character Device->

[*] TPM Hardware Support->

[*] TPM Interface Specification 1.2 Interface

#make bzImage; make modules; make modules_install; make install

2.2 Gmplib安装

# ./configure

# make

# make check

# make install

2.3 Tpm_emulator安装

# cd /usr/src/linux 当前内核的源码目录

# zcat /proc/config.gz > .Config 保持内核配置文件与原来的相同,若没有config.Gz文件,直接用make menuconfig生成.Config文件。

# make oldconfig

# make modules_prepare

# tar -xvzf tpm_emulator-X.Y.tar.gz

# cd tpm_emulator-X.Y

# make

# make install

若Make install出现错误:

make[1]: Entering directory `/home/akshay/tmp/tpm_emulator-0.5.1/tpmd'

install -m 755 -o tss -g tss -d /var/lib/tpm

install: invalid user `tss'

解决办法:将make install改为:sudo make TPMD_USER=root TPMD_GROUP=root install

初始化

#tpmd deactivated

#killall tpmd

#tpmd clear

#rm /var/run/tpm/tpmd_socket:0 (出现failed:address already in use 时执行它)

启动软TPM

#modprobe tpmd_dev (如果出现FATAL: Module tpmd_dev not found,则先运行depmod -a)

#tpmd -f -d            (tpmd -h查看启动参数)

2.3 TSS安装2.3.1解压Trousers软件包

2.3.2重定向tddl

由于使用TPM模拟器,在编译trousers前需要将其以来的tddl库改为TPM模拟器提供的tddl。

l 修改 ./src/tcsd/Makefile.am 第4行:

tcsd_LDADD=../tcs/libtcs.a ../tddl/libtddl.a –lpthread

为:tcsd_LDADD=../tcs/libtcs.a /usr/lib/libtddl.so –lpthread

l 修改 ./src/tcsd/Makefile.in 第59行:

tcsd_DEPENDENCIES = ../tcs/libtcs.a ../tddl/libtddl.a

为:tcsd_DEPENDENCIES = ../tcs/libtcs.a /usr/lib/libtddl.so

2.3.3修改Trousers Bug

l 修改 ./src/include/obj_context.h 第79行:struct tcs_api_table *obj_context_get_tcs_api();

为:struct tcs_api_table *obj_context_get_tcs_api(UINT32);

2.3.4编译,安装

#sh bootstrap.sh

#./configure –prefix=/usr

#make

#make install

2.3.5安装tpm-tools软件包

#sh bootstrap.sh

#./configure

#make

#make install

2.3.6启动Trousers

Tcsd

/tpm_emulator-0.5/tddl# make test_tddl   (测试)

/tpm_emulator-0.5/tddl# ./test_tddl(此测试程序用到了tpm-tools的相关内容)

2. TPM系列——tpm-emulator说明(转)

2009-12-25 14:57

TPM-Emulator说明:

1.       tpmd –用户空间的deamon实现TPM模拟,通过Socket实现访问

2.       tpmd_dev –内核模块提供模拟硬件/dev/tmp,用于后台的兼容性和前台命令接收到tpmd

3.       tddl—tpm驱动库,用与提供模块接口。

注意,模拟器只兼容内核在2.5.x以上的版本。

使用方法:

//install

#tar -zvxf tpm_emulator-X.Y .tar.gz

#cd tpm_emulator-X-Y

#make

#make install

//

//setup tpm

#modprobe tpmd_dev   //将该模块加入内核

#tpmd save

注:

#tpmd [-d] [-f][-h] [start mode]

其中[-d]: enable debug mode

[-f]:force the application to run in the forground 会显示你发送给tpmd的命令

[-h]:print this help message 打印帮助消息

Start mode:’clear’清除之前的状态, ’save’默认情况下打开之前的状态, ‘deactivate’无效

//

//过程中可能遇到的问题是:

1.       使用save模式出错,由于之前保存的模式存在问题导致不能载入因此最好先使用clear模式,清除一下

2.       无法清除时,最好的方法是使用‘deactivate’模式暂停工作后再清除

3.       可能会遇见socket忙碌问题,导致命令不可用,此时需要去早var目录下的tpm文件夹内,把当前的socket文件删除,然后重新执行命令,会重新初始化socket

4.       另外使用tddl函数接口编程,建议在模式选用时用参数f,这样你就可以看到对应的函数执行时具体会使用哪个tpm命令,便于理解。

5.       另外如果您可能没有GMP授权文件,可以到GNU官方下载安装,确保开放源码的权益保障,这也是安装开放模拟器的一个比较条件。

最后您就可以使用tpm-emulator来模拟任何tmp所能做到的事情了。

3. TPM系列——tpm emulator测试程序(转)

2009-12-25 14:58

一个简单的tpm emulator的测试程序,程序实现了通过软tpm产生随机数和求哈希值的功能。注意,此程序是基于tpm驱动层的,与trousers软件没有任何关系。可以通过这个程序验证你的tpm emulator是否安装成功。

代码:tpmrandomsha1.c

#include

#include

#include

#include

#include

#define TPM_TAG_RQU_COMMAND 193

#define TPM_TAG_RQU_AUTH1_COMMAND 194

#define TPM_ORD_SHA1Start 160

#define TPM_ORD_SHA1Complete 162

#define TPM_ORD_GetRandom 70

/*********************first run "modprobe tpmd_dev""tpmd -f -d" and if there is a tcsd ,you cannot run it **********/

int main(int argc, char **argv)

{

unsigned int i,j,fd;

int res,ret;

unsigned char buf[256];

int buf_size = sizeof(buf);

unsigned char random_cmd[] = {0, TPM_TAG_RQU_COMMAND,

0, 0, 0, 14,

0, 0, 0, TPM_ORD_GetRandom,

0, 0, 0, 8};//70 means TPM_ORD_GetRandom

unsigned char tpm_sha1start[]={0,TPM_TAG_RQU_COMMAND,

0,0,0,10,

0,0,0,TPM_ORD_SHA1Start};

unsigned char tpm_sha1complete[]={0,TPM_TAG_RQU_COMMAND,

0,0,0,78,0,0,0,TPM_ORD_SHA1Complete,

0,0,0,64,

1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,

33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64};

fd = open("/dev/tpm0",O_RDWR);

if(fd < 0){

printf("Error: Open() failed: (%04x)\n ", fd);

return -1;

}

printf("sizeof(random_cmd): %d\n", sizeof(random_cmd));

printf("data in random_cmd: ");

for(i = 0; i < sizeof(random_cmd); i++)

printf("%02x", random_cmd[i]);

printf("\n");

res = write(fd, random_cmd, sizeof(random_cmd));

if(res != sizeof(random_cmd)){

printf("Error: write random command failed: (%04x)\n ", res);

close(fd);

return -1;

}

buf_size = 256;

ret = read(fd, buf, buf_size);

printf("ret of read random tpm0: %d\n",ret);

printf("read tpm0 random data: ");

for(i = 0; i < ret; i++){

printf("%02x ",buf[i] );

}

printf("\n");

buf_size = 256;//buf_size > 10

printf("sizeof(tpm_sha1start): %d\n", sizeof(tpm_sha1start));

printf("data in tpm_sha1start: ");

for(i = 0; i < sizeof(tpm_sha1start); i++)

printf("%02x", tpm_sha1start[i]);

printf("\n");

res =write(fd, tpm_sha1start, sizeof(tpm_sha1start));

if(res != sizeof(tpm_sha1start)){

printf("Error: write tpm_sha1start failed: (%04x)\n ", res);

close(fd);

return -1;

}

buf_size = 256;

ret = read(fd, buf, buf_size);

printf("ret of read tpm0 after tpm_sha1start : %d\n",ret);

printf("read tpm0 tpm_sha1start data: ");

for(i = 0; i < ret; i++){

printf("%02x ",buf[i] );

}

printf("\n");

buf_size = 256;//buf_size > 10

printf("sizeof(tpm_sha1complete): %d\n", sizeof(tpm_sha1complete));

printf("data in tpm_sha1complete: ");

for(i = 0; i < sizeof(tpm_sha1complete); i++)

printf("%02x", tpm_sha1complete[i]);

printf("\n");

res =write(fd, tpm_sha1complete, sizeof(tpm_sha1complete));

if(res != sizeof(tpm_sha1complete)){

printf("Error: write tpm_sha1complete failed: (%04x)\n ", res);

close(fd);

return -1;

}

buf_size = 256;

ret = read(fd, buf, buf_size);

printf("ret of read tpm0 after tpm_sha1complete : %d\n",ret);

printf("read tpm0 data after tpm_sha1complete : ");

for(i = 0; i < ret; i++){

printf("%02x ",buf[i] );

}

printf("\n");

close(fd);

return 0;

}

Makefile:

CC    := gcc

all:     tpmrandomsha1

tpm_getrandom:     tpmrandomsha1.c

$(CC) tpmrandomsha1.c -o tpmrandomsha1

clean:

rm -f tpmrandomsha1

测试参考结果:

sizeof(random_cmd): 14

data in random_cmd: 00c10000000e0000004600000008

ret of read random tpm0: 22

read tpm0 random data: 00 c4 00 00 00 16 00 00 00 00 00 00 00 08 20 c2 10 97 bf cb c3 ec

sizeof(tpm_sha1start): 10

data in tpm_sha1start: 00c10000000a000000a0

ret of read tpm0 after tpm_sha1start : 14

read tpm0 tpm_sha1start data: 00 c4 00 00 00 0e 00 00 00 00 00 00 08 00

sizeof(tpm_sha1complete): 78

data in tpm_sha1complete:00c10000004e000000a2000000400102030405060708090a0b0c0d0e0f10111213141516171819

1a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f40

ret of read tpm0 after tpm_sha1complete : 30

read tpm0 data after tpm_sha1complete : 00 c4 00 00 00 1e 00 00 00 00 92 cb 89 df 62 d9 00 b3 50 d9 3e 42 25 ca 6f 08 1d 54 7a 28原文:http://blog.chinaunix.net/u3/96833/showart_1993602.html

uid-20517852-id-1936375.html

4. TPM系列——A TPM for Everyone

2009-12-25 15:18

既然转了,就发扬一下连续作战的风格,一转到底,哈哈~

Introduction

In the past, I've talked about the Trusted Platform Module (TPM) and Trusted Computing in the context of Mac OS X.

October 2006—

October 2006—

December 2006—, 23rd Chaos Communications Congress, Berlin

December 2007—

"Trusted" Computing is usually a contentious topic and the actual utility of a TPM is often overshadowed by a never-ending litany of "what-if" scenarios that have been brought up over time. The Mac OS X specific gist of this is that although the early x86-based Macintosh computers had onboard TPMs, Apple stopped including TPMs in Macintoshes roughly around the time the Mac Pro was introduced. In contrast, it is quite common to find TPMs in modern day non-Apple computers. There are several interesting and useful things one can do with a TPM on any operating system. It is rather disappointing that a modern Macintosh is devoid of this device.

The Next Best Thing to a TPM

Suppose you have a Macintosh without a TPM and you really do want to experiment with Trusted Computing or features of the TPM in general. Your needs could be development-related or they could be purely academic. Well, you could do the next best thing to having a real TPM: you can use a software TPM emulator. has been around for some time and it is straightforward to make it run on Mac OS X.

The TPM emulator is implemented as a daemon that encapsulates most of the functionality of a physical TPM. Out of the box, the TPM emulator will need to be accessed on Mac OS X through an intermediate library—the equivalent of the TPM Device Driver Library (TDDL). It would be nice if all existing TPM-related software used the TDDL interface, but often that's not the case. Instead, software that uses the TPM might want to directly access the TPM device. The Mac OS X TPM device driver I wrote in 2006 for the Infineon TPM chip provides a /dev/tpm device node, which is then used by all the other TPM tools and libraries I ported to Mac OS X. Therefore, it would be really useful if, in addition to the TPM emulator daemon, we had something that provides a /dev/tpm that behaves like the "real thing".

That something would be a Mac OS X kernel extension. It would publish a /dev/tpm device node just like the "real" TPM device driver. However, instead of communicating with the TPM hardware (which does not exist), this kernel extension would communicate with the TPM emulator daemon running in user space. I'm releasing the source code for such a kernel extension—let us call it the TPM Emulator Device Bridge Kernel Extension. Let us see how to set everything up so that we have a /dev/tpm that's functional enough to work seamlessly with TPM-based software.

Setting Up a Software TPM

First, we check out the source code for the TPM emulator from its subversion tree. We will assume that our working directory is /work/tpm/.

$ cd /work/tpm/ $ svn checkout svn://svn.berlios.de/tpm-emulator/trunk tpm-emulator ... $ cd tpm-emulator

Next, download the TPM emulator patch from the Download section of this page. You can apply the patch and compile the emulator as follows.

$ pwd /work/tpm/tpm-emulator $ patch -p0 < /path/to/tpm-emulator-0.5-macosx.patch patching file tpm/tpm_deprecated.c patching file tpmd/tpm_emulator_config.h patching file tpmd/tpmd.c patching file tddl/tddl.c patching file tddl/Makefile patching file Makefile $ make ...

Now download and compile the TPM Device Bridge kernel extension.

$ cd /work/tpm/ $ tar -xzvf /path/to/tpm_bridge.tar.gz $ cd tpm_bridge $ xcodebuild -target tpm_bridge -configuration Release ... ** BUILD SUCCEEDED ** $

We can now load the newly compiled kernel extension. Mac OS X has specific requirements on the ownership and permissions of kernel extension bundles.

$ pwd /work/tpm/tpm_bridge $ cp -pR build/Release/tpm_bridge.kext /tmp/ $ sudo chown -R root:wheel /tmp/tpm_bridge.kext $ sudo kextload -v /tmp/tpm_bridge.kext kextload: extension /tmp/tpm_bridge.kext appears to be loadable kextload: loading extension /tmp/tpm_bridge.kext kextload: sending 1 personality to the kernel kextload: /tmp/tpm_bridge.kext loaded successfully kextload: extension /tmp/tpm_bridge.kext has no personalities $ ls -las /dev/tpm 0 crw-rw-rw- 1 root wheel 19, 0 Feb 23 02:06 /dev/tpm

Once the kernel extension is loaded, we see that a /dev/tpm node becomes available. By default, the kernel extension allows read/write access to everybody for experimental convenience—depending on your needs, you might want to change this in the source. At this point, the device will not behave like a "real" TPM device because we still need to run the TPM emulator daemon, which the device would communicate with.

The kernel extension uses a Unix domain socket to communicate with the emulator daemon. By default, the path to this socket is /tmp/tpm/tpmd_socket:0. Moreover, the daemon needs a location to store the TPM's persistent state. By default, the daemon would store it in the /tmp/tpm/ directory in a file whose name begins with tpm_emulator-1.2. Let us create a /tmp/tpm/ directory and start the daemon. Please refer to the TPM emulator documentation to understand which command-line arguments to use. Initially, we will run the daemon in its "clear" startup mode.

The /tmp location for both TPM persistent data and the Unix domain socket is makeshift. In particular, remember that /tmp will not be persistent across a reboot. In a production setup, you would use more appropriate locations. For example, you could use the per user Documents folder for storing TPM persistent data and the per user temporary folder (the DARWIN_USER_TEMP_DIR configuration parameter) for the socket.

The socket path must be changed both in the kernel extension source and in the emulator source.

$ mkdir /tmp/tpm/ $ cd /work/tpm/tpm-emulator/tpmd $ ./tpmd -d -f clear ... ../tpm/tpm_startup.c:44: Info: TPM_Startup(1) tpmd.c:376: Debug: waiting for connections... ...

At this point, TPM-based software should be able to talk to /dev/tpm just as if the machine had a physical TPM. Please refer to for more information on TPM-related software you can experiment with. The following is an example of what you should see if you run the tpm_demo program from the osxbook-libtpm package.

$ cd /path/to/osxbook-libtpm-2.0c $ ./tpm_demo TPM version 1.1.0.0 24 PCR registers are available PCR-00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ... PCR-23: FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 10 Key slots are available slots = 10, num = 0 No keys are loaded $

Note that this setup should also work on a PowerPC Macintosh.

Download

TPM Emulator Patch for Mac OS X:

TPM Emulator Device Bridge Kernel Extension for Mac OS X:

原文:

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/335395.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

zookeeper 日志查看_每天使用的注册中心zookeeper,流量暴涨怎么办?

通过本文能学习什么&#xff1f;初步了解zookeeper监控如何运用tcpdump Wireshark抓包分析Dubbo在zookeeper上节点设计如何查看zookeeper节点快照背景zookeeper作为dubbo的注册中心&#xff0c;承载着服务的基础信息(方法名&#xff0c;分组&#xff0c;版本等)&#xff0c;服…

javaone_JavaOne 2016 Essentials:您不应该错过的7个事件和会话

javaone参加JavaOne吗&#xff1f; 确保您不会错过这些活动 又到了每年的这个时候。 旧金山一年一度的Java假期即将来临&#xff0c;全市各地举行了超过400场会议和活动。 随着所有这些丰富的内容和新体验同时发生&#xff0c;很容易就无法跟踪正在发生的事情。 在这篇文章中…

python比较两张图片是否一样_opencv_判断两张图片是否相同

python金融风控评分卡模型和数据分析微专业课&#xff08;博主亲自录制视频&#xff09;&#xff1a;http://dwz.date/b9vv本文为原创,转载请注明&#xff0c;作者 231469242qq.com OpenCV介绍 OpenCV是一个基于BSD许可&#xff08;开源&#xff09;发行的跨平台计算机视觉库&a…

bat 存储过程返回值_为什么不推荐使用存储过程?

之所以有这个题目&#xff0c;我既不是故意吸引眼球&#xff0c;也不想在本文对存储过程进行教科书般论述。最近项目中遇到的存储过程问题&#xff0c;让我想起了去年在武汉出差时一位同事的发问&#xff1a;我觉得存储过程挺好用的&#xff0c;为什么你不建议用&#xff1f;当…

Mac下载JDK/安装JDK/卸载JDK

文章目录下载JDK安装JDK配置环境变量卸载JDK下载JDK 访问这个地址&#xff1a;https://www.oracle.com/java/technologies/downloads/#java18 进入下载JDK的界面后&#xff0c;下拉界面到下图所示的位置&#xff1a; 或者访问这个地址&#xff1a;https://www.oracle.com/cn/…

kettle 只有一个输入记录期待设置变量并且至少已经收到2个变量._OPNET学习笔记2...

双击主机网络打开对应的节点模型&#xff0c;从图中可以看到网络的分层&#xff1a;应用层&#xff0c;传输层&#xff0c;网络层&#xff0c;链路层&#xff1b;其中在传输层中我们用到的主要是UDP&#xff08;对实时性要求比较高&#xff09;&#xff0c;网络层又包括IP封装层…

python tkinter控件_Python3 tkinter基础 Label pack 设置控件在窗体中的位置

? python : 3.7.0 OS : Ubuntu 18.04.1 LTS IDE : PyCharm 2018.2.4 conda : 4.5.11 type setting : Markdown ? 普通布局 code """ Author : 行初心 Date : 18-10-1 Blog : www.cnblogs.com/xingchuxin GitHub : github.com/GratefulHeartCoder ""…

oracle的mins,分钟的英文缩写,10min还是10mins!

请问,分钟的英文缩写是min,小时的英文缩写是h,还是hr?秒的..._知乎[图文]时间分钟的英文缩写是什么minutes 10 minutes意思是十分钟的&#xff0c;比如说路程 10minutes就是十分钟 没有10minutes这种表达[图文]分钟 min【minute】 超过多少分钟就用介词past表示超过 还差几分钟…

postman测试工具,如何对参数使用md5加密

先创建环境变量password&#xff0c;并定义了变量值&#xff08;例如&#xff1a;123456&#xff09;访问登录接口通常是post提交登录用户名称和登录密码&#xff0c;且以json格式提交&#xff0c;所以在body-raw-json&#xff0c;填写json串如下图所示&#xff1a; 接着在pre-…

开源java性能分析工具_Java性能监控:您应该知道的5个开源工具

开源java性能分析工具鲜为人知但有用&#xff1a;开源应用程序性能监视的状态 对于任何应用程序来说&#xff0c;最重要的事情之一就是性能。 我们要确保用户获得他们能获得的最佳体验&#xff0c;并想知道我们的应用已启动并正在运行。 这就是为什么我们大多数人至少使用一种…

cmd编译可以通过执行没有结果_Go语言是如何完成编译的

Go语言是一门需要编译才能运行的编程语言&#xff0c;也就说代码在运行之前需要通过编译器生成二进制机器码&#xff0c;随后二进制文件才能在目标机器上运行&#xff0c;如果我们想要了解Go语言的实现原理&#xff0c;理解它的编译过程就是一个没有办法绕过的事情。预备知识想…

如何通过postman测试需要登录授权的接口

思路 请求需要登录授权的接口&#xff0c;就意味着你要传token给接口&#xff0c;所以请求接口&#xff08;要测试的接口&#xff09;之前就要先获取token&#xff0c;因为登录成功后服务端才会返回token&#xff0c;而token又设置了时效&#xff0c;所以每次请求接口&#xf…

wordpress linux 目录,快速搭建WordPress(Linux)

作者&#xff1a;彭济环境要求一、配置LAMP(LinuxApacheMysqlPHP)1、安装apachesudo apt-get install apache2 //安装apache2apache2 -v //查看版本网页访问本机ip地址&#xff0c;查看是否安装成功2、安装phpsudo apt-get install php //安装phpphp -v //查看版本sudo apt-get…

atheros蓝牙设备驱动 小米_小米Air 13笔记本黑苹果WiFi蓝牙硬件改装方案二

该方案适合小米笔记本Air 13初代&#xff0c;适合小米笔记本PRO等型号&#xff0c;适合通用的预留有M.2 PCIE通道SSD卡槽的电脑。也是作者极力推荐的终极改造方案。总体方案: 使用笔记本主板上的M.2 nvme通道 SSD硬盘接口进行拓展。使用BCM943602CS专用的M.2[NGFF]转接卡进行改…

python实现局域网攻击_通过python实现DNS欺骗

假设在一个的局域网内有两个人&#xff1a;Bob和Eve。Eve想让Bob访问他创建的恶意网页&#xff0c;这样她就可以通过隐藏性的下载给Bob的计算机上安装恶意软件&#xff0c;或者可能展示一个欺骗性的站点来试图窃取Bob的认证信息。&#xff08;图片来自以上提供的链接&#xff0…

背景区域为负样本什么意思_词向量-skipgram与负采样

大纲&#xff1a;1. onehot vs 分布式表示2. 分布式表示的全局泛化能力3. how to learn word2vec - intuition4. SkipGram5. SkipGram Negative Sampling6. 评估词向量7. CBOW与SkipGram对比1. onehot vs 分布式表示Onehot表示:V (apple, going, I, home, machine ,learing)ap…

嵌入式linux应用程序实例,嵌入式Linux应用程序访问物理地址的实例

前言  按照Linux分层驱动思想&#xff0c;外设驱动与主机控制器的驱动不相关&#xff0c;主机控制器的驱动不关心外设&#xff0c;而外设驱动也不关心主机&#xff0c;外设访问核心层的通用应用程序接口进行数据传输&#xff0c;主机和外设之间可以进行任意的组合。这样思想要…

线程同步 线程安全_同步装饰器来替换线程安全类

线程同步 线程安全您知道什么是线程安全吗&#xff1f; 如果没有&#xff0c;下面是一个简单的示例。 所有类都必须是线程安全的&#xff0c;对吗&#xff1f; 并不是的。 其中一些必须是线程安全的&#xff1f; 又错了。 我认为它们都不必是线程安全的&#xff0c;而它们都必须…

forge开发_使用Forge,WildFly Swarm和Arquillian开发微服务

forge开发在这篇文章中&#xff0c;我们将看到如何使用WildFly Swarm和Forge开发微服务&#xff0c;以及如何使用Arquillian和Rest Assured对其进行测试。 WildFly Swarm提供了一种创新的方法来打包和运行Java EE应用程序&#xff0c;方法是将它们与足够的服务器运行时一起打包…

zynq+linux固化程序,如何在 Zynq UltraScale+ MPSoC 上实现 Linux UIO 设计

原标题&#xff1a;如何在 Zynq UltraScale MPSoC 上实现 Linux UIO 设计简介作者&#xff1a; Alex He (何晔)&#xff0c; 赛灵思高级嵌入式应用工程师这里的 UIO 即 Userspace I/O&#xff0c;本文中 UIO 泛指 UIO 设备和 UIO 驱动。它在 Linux kernel 的世界里比较小众&…