Brief description of kitl protocol package

Source: Internet
Author: User

English Reference URL http://blogs.msdn.com/ce_base/archive/2006/06/27/648747.aspx

The translation below may be incorrect.

KitlOverview

Kitl -- kernel independent transport layer, basic debugging protocol for CE driver debugging. Provided by kitl

1. Transmission Initialization

2. Data Stream connection and disconnection

3. Data Stream package requests

4. Packet Loss and retransmission

5. Provide interfaces for Applications

 

First, let's take a look at the differences between the kitl data package and the control package. This is the basic knowledge of kitl protocol and problem solving.

 

KitlPackage

All kitl packages are in the same format. Data is added to the header. The header defines the package type and data block. Open a kitl header and you will see

 

1. Protocol mark

Fixed string: edbg (45 44 42 47)

 

2. Stream ID

Each kitl stream has a byte for storage. There are 4 pre-defined streams, and other locations are reserved for use by the application.

0x0: Debug message

0x1: target control

0x2: kernel debugger

0xff: control flow of protocol Management

0x3-0xfe: reserved for application

 

After a registered kitlregisterclient has been circulated, these stream IDs are passed to the application from kitl. The application uses these IDs to send and accept data packets from a specific stream through kitlsend and kitlrecv.

 

Package Type

One byte to indicate the package type

0x1: messages sent by the device

0x2: this frame is nack

0x4: this frame is ack

0x8: resetting the application number to zero

0x10: Control Messages of corresponding kitl

 

Package Application No.

Defines a byte, stores the package application number, and rotates from 0 to 255. When the 255 package application number is sent, the next package application number will be restored to the number 0. If both the desktop and the device have their own application numbers, asynchronous data transmission is allowed, and more data packets can be sent on one side than on the other.

 

Data commands

The real data of ktil is closely followed by the header description. A large amount of raw data depends on the following commands

0-4: Not used now, reserved

0x5: device reset

0x6: service settings

0x7: Service Data

0x8: kernel debugging paused

0x9: transmission settings

0xa: Time package

 

Now we can look at the content of the kitl package based on these formats.

1. kitl transmission settings package:

The first package sent from the device after kitl is started. It is sent to a specific port (Port 981) through the subnet wide broadcast address. PB sends a response from time to time from the detection device through the host configuration message package. Then the device and the desktop are connected by opening a kitl channel, and the subsequent communication process is through this channel. If it is green, the device sends the content of the transmission setting package through port 981. The Network package includes the device name (cepc37133), device IP (9d 38 B2 12), and device UDP port (0x3d5. The desktop opens the channel through this information.

0000002045 44 42 47 ff 00 edbg ..

0000003000 0920 00 30 0043 45 50 43 33 37 34 38 3000... 0. cepc37480.

00000040 00 00 00 00 00 009d 38 B2 1200 11 95 28 92 68... 8... (. h

00000050 03 D5 ..

 

2. kitl service configuration package:

Both devices and desktops send such packages. When a service (kitl stream) starts, both the device and the desktop need to respond to the service configuration package of the other party. Below is a DbgMsg service package sent by the device. The kitl header is marked in green. Others are set data. This is a control package sent from the device (0x01) (the Protocol is marked with 0xff), using the application number 0x00 (the stream is not connected ), the command of the package is 0x06 (service settings ).

0000002045 44 42 47 ff 01 edbg ..

0000003000 0601 44 42 47 4D 53 47 00 33 37 34 38 30 00... dbgmsg.37480.

00000040 00 00 00 00 00 9d 00 10 00 ..........

 

3. Response to the service setting package:

The following is the response packet of a service configuration package. The header is marked green. Note that the package type is changed to 0x10 (the response of the control package). The other parts are the same as the service setting package. This package is sent from the desktop to the device. When the device receives the package, the DbgMsg stream is connected. In this case, the device application can start sending debugging information to the desktop. Note that this stream is fully connected after the desktop sends a similar setting package and returns a response.

0000002045 44 42 47 ff 10 edbg ..

0000003000 0601 44 42 47 4D 53 47 00 B8 A9 FF 02 A0 F9 ...... DbgMsg .......

00000040 FF 02 18 6a 4A 45 02 ff 00 00 ....

 

4. kitl data packets:

The following is a relfsd package sent by a device. The kitl header is marked in green, and other data is left to the relsd stream for explanation. Here, the stream ID is 0x1 and the type is 0x01, indicating the package sent by the device. The application number is 0xa4, and the package command is 0x07, indicating that the package is a service data packet. This is what shell.exe of the device sends to the desktop. Check whether commands need to be run on the device.

0000002045 44 42 47 01 01 edbg ..

00000030A4 07AA 55 55 AA 04 00 0d 00 Fe FF 01 00 ...... UU ...........

00000040 00 00 F2 5A A5 0a 1A... z...

 

5. kitl ack package:

From the desktop to the device. The label of the lower bread is set to 0x01, the type is 0x04, the package application number is 0xa4, and 0x07 is the packet command. If the device answers the desktop package, the type should be 0x5. For desktop reply devices, the type is 0x4.

0000002045 44 42 47 01 04 edbg ..

00000030A4 0700 00 00 00 00 00 00 00 00 ............

 

6. kitl Timer control package:

Each 2 is sent to the device by the desktop. When the device stops running in the kernel debugger, the time in the device stops. Time-related operations cannot work either, including the logical time of kitl. In this case, use this package as a flag to resend the lost package to the desktop.

0000002045 44 42 47 ff 00 edbg ..

0000003000 0a00 00 00 00 00 00 00 00 00 ............

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.