Unix/linux Environment C Programming Novice Tutorial (opensuseccpp) and Linux kernel-driven development environment building

Source: Internet
Author: User


1. openSUSE is a great Linux game.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

2. Select the default virtual machine


3. Select Install the operating system later


4. Select Linux openSUSE


5. Select the default virtual machine name

6. Set the processor to dual core.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

7. Memory set to 2G


8. Select Network Address Translation


9. Setting up the IO controller


10. Select the default disk type

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

11. Create a new virtual disk

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

12. Set the disk size

13. Select the path to save the virtual disk

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

14. Complete Virtual Machine creation


15. Setting up a virtual machine


16. Select the openSUSE image

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>


watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

17. Turn on the virtual machine

18. Virtual Machine Startup

19. Installing openSUSE

20. Install the program loading

21. System Startup


22. In System initialization

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

23. Select Chinese and start the installation

24. Allow Agreement

25. Click Next. These two steps might be complete.

26. Click Next

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

27. Synchronizing N Tpserver

28. Click Next


29. Select KDE Desktop

30. Set up account password

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

31. Start the analysis system

32. Start installing the Software

33. Select all options


D/C + + development

Linux kernel-Driven development

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

34. Start the installation

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

35. In the installation

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

36. When the installation is in progress

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

37. Install and enter the interface

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

38. Write a C-language HelloWorld

39. Start the terminal

40. Enter the path

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

41. Compile and run

42. Write a C + + code 1,CC

43. Print statements, C + +

44. Print out the results

45. Drive HelloWorld


#include <linux/init.h>//driver initialization

#include <linux/module.h>//Drive Module

Module_license ("Dual BSD/GPL");//Follow the Linux protocol

static int hello_init (void)

{

PRINTK (Kern_alert "Hello, world\n");//Print driver information

return 0;

}

static void Hello_exit (void)

{

PRINTK (Kern_alert "Goodbye, cruel world\n");//Print driver information

}

Module_init (hello_init);//Print driver initialization information

Module_exit (hello_exit);//print driver end information

46.Q Driver compilation options, note that the All,clean the following actions must be preceded by the TAB key


PWD = $ (shell pwd)

KERNEL_SRC =/lib/modules/$ (Shell uname-r)/build

Obj-m: = hello.o

MODULE-OBJS: = hello.o

All

$ (make)-C $ (KERNEL_SRC) m=$ (PWD) modules

Clean

RM *.ko

RM *.O

47. Compiler driver

48 Super Admin Load Driver


49 See driver output

50 Uninstall the driver and view


51 Drive exits.

watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvaxrjyxn0y3bw/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma==/ Dissolve/70/gravity/southeast "/>

52 Times Full Drive

53. Driver List

54.

This time the openSUSE ccpp and Linux kernel-driven development environment has been set up, I hope you will seriously practice.

Unix/linux Environment C Programming Novice Tutorial (opensuseccpp) and Linux kernel-driven development environment building

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.