Welcome to TechSoup, everybody. This is the new member orientation and Q&A. My name is Arita Simons. I'm so glad you are here. I'm gonna show you how you can engage on the next slide so we can get right into this. This is your first time on one of our webinars. You know that you are on mute. We would love for you to put your questions in the Q&A section so we can answer them as they come up. We will email you the video and the slides within 48 hours, probably tomorrow. And if you need to close caption, go ahead and type on the CC button at the bottom of your screen. I'm gonna go ahead and turn this over to Nick Finn and have a great webinar, everybody. I'll be right here in the chat. Hi, everybody. Thanks for coming today. Welcome to TechSoup. I know that we have two different groups of folks on the call today. One is a group of folks whose organization has just joined TechSoup. You're brand new to us. We're brand new to you. So this is the right place to be. Some of you I also know are new to the organization or in a new role at your organization, but they have an existing TechSoup account and you're here to learn more about how TechSoup can help your nonprofit. Both of you are in the right place. Thank you so much for being here. My name is Nick Finn. I'm the head of global growth marketing here at TechSoup. And I'm pretty psyched every time I get to do these presentations with folks who are new to TechSoup. And we are gonna get rolling here. You've already met the wonderful Aretha Simons. I'm Nick. You're also gonna be joined today by Tony Phipps and Kelly Garrett, who are some of the folks at TechSoup who support our customers, our users in their journey with technology. And Tony and Kelly will talk more about that as we get toward the second half of the presentation. I wanna start with some key terms that are important to understand. Because we talk about them a lot in nonprofit technology circles. But I don't wanna always assume that everybody knows exactly what they mean. We talk about civil society. And when we do, we're really talking about the change makers, the people working to do good around the world in nonprofits and NGOs, charities and other organizations. These are the folks who are not working in a business and they're not working in the government per se. That's what civil society is. It's the broad group of human beings around the world trying to make the world a better place through various institutions, right? Another term you'll hear talked about is digital transformation. And this really is the process of organizations really embracing technology as a tool that can help them achieve their goals to improve their functions and to improve for nonprofits the delivery of their programs, right? And it really is a different thing than just like accepting that you have to work with technology. It's a much more positive proactive approach that says we're embracing technology to do those things. Digital resilience is another term and it's really how we can ensure that a nonprofit's technology can help that nonprofit to respond, to adapt and continue to serve during an external disruption or some kind of crisis. Those can look like anything. And they're happening around the world, around all of us all the time. For some folks who are operating in a war zone, digital resilience is an absolutely critical piece of an NGO or nonprofits operations. But there are of course numerous ways in which digital resilience matters in lots of environments. Cloud adoption is another term that we talk about in nonprofit technology circles. And I almost feel like we don't need to really bring this up anymore to folks. I think everybody really does understand it, but to recap it, it's this notion of moving away from just like software that's loaded on a local computer that sits on your desk toward these large integrated global platforms that exist in the worldwide web, right? In servers around the world and that we tap into these platforms and use them to communicate with each other, to share resources. And so it's that whole idea of moving off of your local desktop into the worldwide web as a tool and as a platform. Now let's get into the meat of our discussion today. What is TechSoup?  We do not exist to create a profit. We are not a business. We are a nonprofit 501C3. This doesn't mean that revenue doesn't matter to us. Of course it does, otherwise we would not be able to continue operating and providing the nonprofit sector with the services and support that we provide. Our mission is to support nonprofits who are working with technology to build a more equitable planet. Each of you working in a nonprofit on this call have a mission statement that your staff and leadership adhere to. And we have that as well. And our big goal is that equitable planet perspective, but our perspective is that nonprofits can get us there or help get us there and that technology can be a powerful tool in your arsenal. How do we do that? Well, TechSoup hosts a catalog online at TechSoup.org of affordable technology products for major brands like Microsoft, Dell, Intuit, Adobe, and many, many, many more. We do understand that sometimes the cost of technology itself is one of the real blockers for nonprofits adopting technology. So we do the best that we can to negotiate good prices with these technology providers with these companies that make platforms and then pass those savings on to nonprofits. TechSoup charges its own modest admin fee to support our operations as well. In addition to the catalog at TechSoup.org, we also provide numerous services to nonprofits to help them with technology. And in fact, I would say today that's almost the most important part of what we do. We know that for nonprofits, simply buying or acquiring a technology product is not the end of a journey, it's the beginning. Once you have paid for and gotten that technology product, there are a host of new issues that come with it. How do you implement it properly? How do you train your staff to use it? How do you manage it over time? How do you make sure that that platform is secure? How do you learn about all the special features that that platform can offer? How do you know if a platform you're using perhaps is reaching the end of its functional help and maybe it's time to look for something else? How do you make sure that the technology you're using is the best that you can get for what your mission is? These are the kinds of questions that TechSoup can help you think about. And our services are very specifically designed to help nonprofits and we'll talk more about those specific services in a minute. But they're there to help you deal with these different technology products, both software and hardware that your nonprofit might be using. In addition to the product catalog and the services, we also provide educational resources broadly to the nonprofit sector. Those can look like a lot of different things. Sometimes it's a PDF that you can download to learn about something. We have all sorts of videos online about helpful tips and tricks. Sometimes they can be in a context like a live webinar like what we're doing today. But those are free educational resources that we provide to the sector to help you understand more about the technology that you're using or that you might want to use. And then finally, again, going back to the first notion of being a 501C3. In addition to the products and the services and the educational resources we provide, TechSoup also does its own grant-based programming, meaning that we also spend time applying for grants from foundations and funders and then using that money to execute specific projects in the nonprofit sector, helping nonprofits deal with sustainability and issues related to their digital resilience, all sorts of different one-off projects, like similar to what most of you probably work on. So in the big picture, like you again as a nonprofit, TechSoup actually does a lot of different things and it really depends on what angle you're coming at TechSoup. And just because you interact with us in one way does not mean that's the only thing that we're doing. We have a lot on our plates and we all wear a lot of hats during the day at TechSoup. We serve nonprofits of all sizes as well. And this is just a quick chart to kind of give you some visibility into what that distribution looks like. But that includes nonprofits that serve or are themselves traditionally underserved or high-touch, high-impact and low-margin. All nonprofits are within TechSoup's scope of mission. That is part of what we believe that we need to do as part of our mission. And in terms of specific topical areas, it runs the gambit again. Nonprofits in the US and around the world touch almost every major issue that human beings face. And similarly, so does TechSoup. We work with nonprofits across all these different mission areas. So let's start by talking a little bit more about that product catalog I mentioned up front. Here I've got a screenshot of the TechSoup website, TechSoup.org, this was taken a while ago so that top image might look a little different. But you'll see right there in the middle of the page there's a browse catalog button. You can also see at the top in the black navigation bar there is a product catalog. That takes you to the offers that I wanna talk about and I'm gonna start with Microsoft. By far, TechSoup's largest partner over the course of our existence has been Microsoft who were very supportive of nonprofits early on and also encouraged TechSoup to really dream big about what our mission could be. We've offered a lot of different Microsoft products over time. Today really what most nonprofits are coming to TechSoup for is Microsoft 365, which is the cloud version of the Microsoft Office Suite that we are all familiar with with Word and Excel and PowerPoint. But the cloud version of that Microsoft 365 is really what most nonprofits are leveraging through TechSoup today. Also through TechSoup we do have access to the Windows Proful operating system. But the Microsoft partnership is a big deal in the TechSoup catalog and if your organization is thinking about bringing its Microsoft stack sort of more current, wanting to look at Microsoft 365, I definitely encourage you to look at TechSoup for that and you'll get access to some really great experts like Tony who's gonna talk a little bit later here who can really help your nonprofit like get that Microsoft 365 instance set up correctly, choose the right license, don't pay more than you actually need to be paying, migrate your email and your data, all those things. Adobe is another very big partner with TechSoup. If you work in graphic design or web design or communications and nonprofits, you're probably already using an Adobe product somewhere. Creative Cloud is the one that lots of graphic designers for years now have been leveraging through TechSoup. If you're not trained to use Creative Cloud, it can feel a little overwhelming. We also have Acrobat Pro DC, which is really the Adobe standard for managing PDFs, the portable document format. And the new latest and greatest offer from Adobe at TechSoup is called Adobe Express. It's currently available through TechSoup for a $0 admin fee. Adobe Express is really designed to be a more user friendly, easier platform to use than Creative Cloud. If you do a lot of social media and you need stuff to post online a lot, Adobe Express is a wonderful product to take a look at. Into it, QuickBooks is also a very, very solid choice at TechSoup for lots of nonprofits. It didn't take much more than a global pandemic four years ago to remind everybody that a paper and pencil accounting system is not good enough.  And QuickBooks is really the platform that most nonprofits who come to TechSoup end up using. We have online plus at $75 a year. And then there's an advanced version as well. These are really cloud based products from QuickBooks. Definitely something that lots of folks look at. We have a ton of other brands in the TechSoup catalog, by the way, not just those three. And while I'm not gonna go into each of these deeply, I do wanna share with you the broad swath of offers that we do have at TechSoup from these different brands. You know, that includes Cisco, which is a wonderful networking and some newer stuff that's come to catalog for us. One thing that I always like to point out because I have a little bit of an arts background, for instance, is Autodesk, which is this great CAD and design platform that some arts organizations sometimes use. You see GrantStation on this page as well. They provide a product that helps nonprofits look for opportunities for grant funding online. And we actually do a special promo with GrantStation twice a year. And we had ours two, three weeks ago, was super successful. Always a great bellwether for how nonprofits are feeling. Software is not the only thing you can find in the TechSoup catalog. We do have access to hardware as well. To see our hardware offers, you have to start by going to the product catalog in the top navigation. And then you'll see that hardware now pops down below there. We have new and refurbished laptops and desktops, servers, networking and internet hot spots and headsets. And we have other things that come through this catalog all the time as well. It's interesting to just keep an eye on what's available there. TechSoup's built relationships with Dell, Lenovo and HP, where we do provide access to some special discounted rates through those manufacturers. One of our biggest lines of hardware is refurbished hardware. Excuse me. Refurbished hardware is where you take a computer that is no more, it's not brand new anymore. Maybe it's a year or two old. And a refurbisher does a once over on that computer, makes sure it's wiped clean of any information and then makes sure that the hardware and the software in that computer are up to spec for what a modern computer would have to do. But essentially, you're buying a used computer that somebody has certified is still completely powerful and able to handle the work that you need. There's two great advantages to this. One obviously is cost because you're not paying the brand new price, but the other is it's a much greener practice than just simply sending all these hardware packages to landfill when people feel like they no longer have to use them. And TechSoup was one of the pioneers in this refurbished hardware industry. It's an industry that's grown quite a bit since the early days, but those refurbished units are still available through TechSoup and so, if really pinching down on expenditures as part of what you're worried about right now, that's a great place to look for some additional savings. And like I said, we often have other things coming through the hardware catalog, mobile devices, monitors, networking equipment. One thing I don't have on this slide at all right now is we introduced a couple of weeks ago the MetaQuest Pro device to the TechSoup catalog. That's the virtual reality goggles. And it's super interesting to watch how nonprofits would adopt these and figure out some use cases for them. Even though virtual reality itself has been a topic of conversation for decades now, we're only just starting to really get to the point where that hardware is easily accessible to folks and now it's a real question of like, how are folks gonna adopt this? What are the different ways in which virtual reality itself can be a technology that might help nonprofits? All right, so moving on from the product catalog itself, I wanna talk about the services that TechSoup also provides and as I said, I think these are almost our core offering now because so many nonprofits need more than just help with getting like saving a little bit of money on software and hardware. It's really like, how do you implement these different pieces of software and hardware? How do you manage them? How do you troubleshoot them? How do you make sure you're getting everything out of them? You know, the value, as they would say, how are you really making sure that you're getting everything out of that software and hardware that you really hoped to get? Our services are available in the drop-down menu again at the top under services, self-explanatory. We are adding new stuff all the time. I wanna talk about a couple of things. The first is our helpdesk service which is available both one off or for like a monthly or annual subscription, but helpdesk is really TechSoup helping you figure out a specific thing, an isolated problem. Maybe there's a printer that you have in your office or at home now in remote work that is just consistently giving you issues, something like that. A helpdesk support ticket is a way that you can get TechSoup to help you deal with whatever that small-scale technical issue is. On the other hand, some organizations don't need one-off solutions for small things. They're looking for help in a much broader context, how to manage their overall IT stack. That's what our managed IT service is about. This is really helping nonprofits to manage all their technology, soup to nuts, end to end, having a strategy in place, really thinking through what the important questions are around their technology acquisitions. For most nonprofits, the primary communications channel you now have with the public, with your supporters, with your own users and constituencies, and maybe other folks like elected officials or journalists, it's your website, right? And what a profound piece of technology that is. Your website says everything about your nonprofit. And yet, if you talk to nonprofits about their websites, it's very, very rare that somebody says, oh, my website is great. It does everything I want it to. Most people are saying, oh my God, I really need help with my website. How can we change this? What can we do? What should we do? TechSoup's website services are there to help you answer those questions and then figure out how to implement changes to your website. And I'm gonna be right up front with you here. That's not free. There's a cost involved with these services, right? Because they are real and legitimate pieces of how to help your organization run better. And so if you're thinking about making changes to your website or if you need an entirely new website, think about what the budgeting is around that, but take a look at TechSoup's website services as a way to help bring your nonprofits website up to speed or at least get it into a better place. If your nonprofit also engages in outbound marketing, and sometimes we just call that outreach, right? Because again, like we're a nonprofit, not a business, but marketing, outreach, whatever you wanna call it, we can help your nonprofit structure some of that as well, especially if we're talking about advertising you might place on other platforms or thinking about search engine optimization for your website, making sure people can find you, if you send out email, if you're engaged in social media, or maybe you really have a customer relationship management tool that you're working with, our marketing services can help you do things in those areas where you feel there needs to be improvement. We have a new service that we launched some months ago called Domain Registration. There are lots of folks who launch nonprofits with a wonderful view on the good work they could do in the community, but maybe don't have the technical background to figure out how to set up their own website, how to register a domain based on their nonprofit's name. It's a small technical thing, but we can help you with that. So you wanna check out the Domain Registration Service at TechSoup. And then as I mentioned, if you're looking at Microsoft 365, there is a specific email and data migration service that we offer for Office 365 that may well be part of what you should be interested in if you're looking at that platform. I also wanna call out something at TechSoup called the Digital Assessment Tool. It's available in that services dropdown. The Digital Assessment Tool is not a service so much as it is a way for you to evaluate how your nonprofit is doing on various measurements of its technical aptitude. How is it best using technology across different functional areas of the nonprofit like fundraising or finance or human resources, right? It sends you through a series of questions where you provide answers about what your nonprofit's currently doing. And then at the end of that, you get some score on how you're assessing your digital readiness in those various areas. And those things can help you in a couple of ways. I mean, one is obviously it gives you a path to pursue to improve your nonprofit's operations. But in some case, it also provides you with ammunition to build a grant application with where you're saying to a funder, hey, we really need to improve this particular part of our nonprofit's technical stack. And in fact, we've gone through the TechSoup Digital Assessment Tool and it's proposing that we look at these things. And so sometimes this can really be an effective fundraising tool for you if you're looking for some money to particularly focus on a specific area. All right. Past services now, I do wanna call out something particularly special at TechSoup, which is called TechSoup Boost. Boost is a membership product at TechSoup. It's a subscription that gives you access to sort of a more agenda strengthened version of TechSoup. There are some offers in the Boost catalog that you won't find in the broader TechSoup catalog. There are some discounted rates and savings in the Boost catalog that are more aggressive and a little different than what you see in the rest of the TechSoup catalog. And we're also building out Boost more with ideas around how to help nonprofits choose particular products by providing some content that does this versus that evaluations, right? And so if you are a nonprofit that thinks that you will be particularly forward thinking in technology, TechSoup Boost is something you should really take a look at and think about becoming a TechSoup Boost member because it will just give you a deeper engagement with TechSoup around these technical products. The annual membership at this point is $99. And yeah, I think it really is the sweet spot of a TechSoup membership right now. We have a second membership level called Quad. Quad is sort of the most powerful version of TechSoup and it's really designed for nonprofit leaders who really don't wanna worry about their technology stack. They really want somebody else to help do all the thinking around that to help them figure out what it is they need to do. So Quad is the deepest level of engagement with TechSoup. It may not be for everybody, but it really is for the power user, the place where TechSoup probably has the most value. It is currently a $200 annual fee per organization. And so if you really are thinking that you want like the most support you possibly can get from TechSoup, I recommend taking a look at Quad. Now, another thing that I really love about TechSoup is this organization really walks the walk more than just talking the talk when it comes to human beings. And that means a lot of different things. As somebody who works at TechSoup, I feel that with my colleagues and coworkers. I really enjoy the people that I work with and they're all really dedicated to helping other nonprofits do well in the world. But the other thing it means is for you that TechSoup is not just some website that you make product orders on and that's all. We have live human beings who are here to help you in that process. And so I want to bring two of them to the forefront now. The first is Kelly Garrett and her team. Kelly is an associate account manager in the client services department at TechSoup. And what client services do is work directly with nonprofits in managing your TechSoup account, right? So if you've got issues with like how an order was placed or something to do with resetting passwords or you need to add a new person to your TechSoup account, anything like that, Kelly and her team will be able to help you. So I see Kelly's slide has come up there. There's Kelly, she's coming off mute. You can take it away. Thank you so much, Nick. Welcome everyone. I've been chatting with you in the webinar chats and answering your questions in the Q&A section that we have. Please feel free to keep putting those in. I think I've gotten to most of everybody's stuff, but I'm gonna be explaining how you can get in touch with customer service and all that good stuff in case you have any follow-up questions or is there anything we missed during this webinar. So first things first is a lot of questions we get from our new members is asking about product information. How much does it cost? Is there a renewal fee? What's the subscription timing? When am I gonna have to pay for this? All good questions, all important questions and we have set up our website to try to answer pretty much all of the common questions and in providing the information that you all need to know. So QuickBooks Online Plus is probably one of our most popular products, especially right now. We know it's tax seasons for folks. We've been seeing a lot of requests, a lot of questions about it. So this is the product I like to go over with new members to kind of highlight where you can find all the information that you're looking for. First things first is when you search either by using the dropdown options on the top left corner which Nick highlighted earlier. So there's the donor company category or hardware or use that magnifying glass in the top right corner to look for a specific product and you find it. You click on the product's name and you are brought to this landing page which we call the product page or the offer detail page. This wears all the details are. First thing I tell everyone to look at is all the information underneath the name of the product. You'll see the partner which you can click on to see what other products they offer. So this one says Intuit. You could click on that and it would take you to the Intuit program page with all of their products listed. It tells you what categories this is in. So if you were actually use the dropdown category menu and click to counting, you'd see this product listed there. You could also click on it right there and it would take you to a category page where you could look at other accounting software. Right now we pretty much just have QuickBooks as accounting software. The rest of the things in that category are gonna be like payroll add-ons and things like that. Below that you'll see the availability. If it's out of stock, it will say out of stock. You'll also see the format or the platform. So multiple platforms. Really important to note, sometimes it's Windows only product, sometimes it's Mac only product. So it was a good idea to really review that. Then there's also going to be three tabs of information on every single page. They can be labeled differently. It's usually description on the left, which is what you start on. And then the rules eligibility restrictions on the right. The middle tabs name can change depending on the product. We do have products for example that are access to discounted rates. This means that you pay TechSoup and admin fee to access the discounted rate. And then you pay that discounted rate to the provider. Zoom's a very popular product for access to discounted rates. You pay TechSoup $18. We send you a coupon code.  So always a good idea to check all three tabs because that kind of information will be detailed. Description is the first place to go. If you scroll down that page, you're going to see benefits for your organizations, how you're going to obtain the product. Pretty much all the software and services you see are remote or electronically delivered and facilitated. Only hardware is going to be physically shipped. When you're checking out you'll probably, you usually see a shipping address on there. If it's not a hardware product you don't really need to worry about that. That's just, you're going to be getting an email, a fulfillment email with your fulfillment information that you'll use to get that code, get that download link. And that information is stored in your My Account. You have a request history section and a fulfillment email section in your My Account. So I always recommend going and checking there for any pending requests, looking for your fulfillment email. We try to make sure everything's accessible through your account. So I really recommend poking around and familiarizing yourself with that. Our next slide please. So middle tab, especially when it says subscription details I highly recommend always reviewing thoroughly before requesting a subscription product or an access to discounted rate product. This is where you're going to see continuing service after one year that explains what's going on, on what you can anticipate. It also has links to the system requirements. It lets you know about system limitations. When your start date was, all the information that you're kind of looking for and a lot of questions that we get are answered in this middle tab. It's easy to miss since they are a little small and it's kind of gray on white, something we've heard from our members and are keeping in mind. But make sure you're clicking through all three, reading everything before you request a product or a service since many are not refundable and cannot be exchanged. That's a thing that we TechSoup have in our checkout agreements and most of our providers have as well. The idea is that if you request something and don't want it anymore, we can't get it to another non-profit. Now that license been wasted and a lot of our providers only give us a certain number of licenses, products, discount codes, et cetera per fiscal year. And so we do really try to make sure that everyone's checking out with what they need and we're not issuing a lot of refunds and stuff. Perfect. Next slide, please. So when you're looking for support, if you have already checked the product page and you are not seeing what you were looking for, if you're not seeing what you're looking for, then I recommend going to the help tab. It's all the way at the top. It's always gonna be next to the login button or it's going to be that circle icon with like an outline of a person. That's what you see when you're logged in. That's how you access your account. Help button's always gonna be right to the left at that, right to the left. It's gonna be right there. So next slide, please. When you click on that, you'll be taken to TechSoup Support. That is support.techsoup.org that has a ton of really informative articles, how-to's. We're constantly developing this. We're constantly updating it. So really recommend going and checking here every time. You have a question. A lot of times you're gonna be able to find your answer either on the product page or in this TechSoup Support articles. Next slide, please. So TechSoup Support and also TechSoup Customer Service on support.techsoup.org and www.techsoup.org is designed for US-based organizations. If your organization is not based the United States, if it's located in Canada or somewhere else, you do need to go to that specific partner's website to access that support service and your account information. We basically have different partners in different countries and regions that can provide support. The information I'm giving you right now is for US-based organizations. And that's where you wanna get started is techsoup.org or the support.techsoup.org. We also have this great article highlighting everything that Nick went over earlier. It's all about the products and services like Quad. If you wanna learn more about that, it's got links to the different pages. We have product information. It explains how I just went over where you look at the information, making sure you're looking at those tabs. Highly recommend checking out this URL. We do send out the slides and the recording after this. You can also type in techsoup support services or techsoup support on the support page and you should be able to find this article pretty quickly. It's one of our more popular articles. So it does populate usually at the top of your search list. Next slide please. So what can techsoup customer service do for you? Again, this is for US-based organizations. We can assist you with account management, eligibility questions. Not every organization is gonna be eligible for every nonprofit program. It is based on location. It is based on budget, size of organization, your mission, lots of different factors go into it. And it's not a comment on the good work your organization's doing. Providers just have their own philanthropic focus and they are focused on certain types of organizations, certain organizations under a certain budget. And some of their products, it's over a certain budget under. So eligibility questions, always check the product page. If you still got questions, welcome to reach out to us and we'll explain it to you. We'll also help you navigate resources, requesting products. What we can assist you with is IT support and in-depth product support and in-depth product functionality questions. That's because customer service is in charge of helping folks with all of these different products, all of these different providers. We have not created any of these products except for the services. And so a lot of times we're gonna ask you to go back to the partner or the provider that is offering that nonprofit product or service. So for example, if you were having issues installing or activating your QuickBooks online plus, we would send you to Intuit Support so that they could assist you with downloading and installing and using their product. It's the same products on the commercial market or retail market as it is available on TechSoup. The only difference is you're getting an admin, the admin fee is going to be a nonprofit rate. So it's gonna be the best rate out there for the market. So that's something to keep in mind. If you do need support services and the provider hasn't been able to help you, I highly recommend going back to that support article that I highlighted before and that will help you pick out maybe a help desk support quad. You might wanna join quad, you get a dedicated support team, all that good stuff. Next slide please. Yes, the fees, I just saw someone answer, the fees quoted are US dollars. TechSoup.org is for United States-based organizations. All the fees are US dollars because only United States-based organizations are gonna be able to check out with those. So just to keep that in mind, I know we have a couple of people from Canada, a lot of this stuff, you're gonna need to go and double check on TechSoup.ca. That's where the TechSoup Canada website offers, catalog, your account are located. That will have the admin fees that you're going to wanna check in. Perfect. For this US customer service, we have recently launched live chat. We have our exclusively assisting folks through live chat. We no longer have phones or contact us form. Instead, we've got our live representatives giving support from usually 7 a.m. I apologize, there's a typo here. It's usually from 7 a.m. to 3.30 p.m. right now. You can always check what our weekly live chat hours are by clicking the Help button. And that will let you know when we are available. It is Pacific time. We are located on the West Coast. So something to keep in mind is that if you're not seeing that live chat option, you might be outside of our hours of operation, which you can always check in that Help bubble. These are subject to change based on holidays and other factors. So something to keep in mind is always check those daily hours. And then I do have some troubleshooting in case you are within hours and you're not seeing our live chat as an option. Next slide, please. So when you're looking for help for TechSoup US customer service, you are going to go to www.techsoup.org or support.techsoup.org. I'm showing you the main website right here. You'll see that there's a Help button in the bottom right corner. You'll see at the top there, there is the hours are listed in the black header. And then you'll see that black live chat button within the pop-up window. Next slide, please. So I'm not able to connect to live chat. What's going on? We've done a thorough testing and we've looked very much into this. We sometimes get reports from members that they don't see the Help button bubble or they don't see the live chat button. And we've pretty much determined that this has to do with the device being used or the browser being used. One of the big things to keep in mind is that we don't recommend mobile devices to access our website. That would be cell phones, tablets, et cetera. We really recommend using a computer to access www.techsoup.org. If you use a mobile device, you're not gonna see the live chat button on that website. Support.techsoup.org is on a different platform. So you will actually see the live chat button if you use a mobile device. But overall, everything usually runs a little bit smoother if you use a device for navigating the website, accessing chat, checking out, account management, all that stuff, I really recommend a computer. If you are using a computer and it's still not popping up, try a different browser. Make sure your browser is the most up-to-date version on the market. We have found that older versions of browsers are not always loading the live chat button. We've had several members confirm this. We've also found that pop-ups and blocker extensions in your browser settings will lead to the help bubble and the live chat not appearing. So make sure you're turning that off or you can try a completely different computer. If you're at your work computer, maybe try your home computer. And we do have a great forums post that we recently posted this week that has more in all of this information here, along with the screenshots that we showed you. So that is the recommended troubleshooting. This so far has worked for everybody that I've had report an issue to me that I've worked with. It is a device or it's a browser issue. We are taking actively taking chats and we've tested our systems when we've forgotten these reports and we figured out that it's on members' ads. I believe that might be my last slide, but next slide, yes, that is my last slide. I did see there were some questions for me, so I'm gonna try to clear those out right now before we end this meeting. Tony, I will let you take it from here. Thanks, Kelly, appreciate that. I appreciate everybody being on the call. Welcome, welcome. As Nick and everyone has shared, I am part of the customer success team. My name is Tony Phipps. And customer success, what are we about? Well, there's seven of us on the team and we basically try to walk the organization through whatever phase that you're in with your technology, whether it's just learning more about the products and services that TechSoup has to offer. Maybe it's about your technology stack and am I using the right thing, am I not? So we really try to meet the organization where they're at. So as you can see here, it's got a little bit of some examples of how we are as a team. We've got over 20 years of experience helping nonprofits. We definitely are involved with all the different products and services. So we try to teach you more about that and see if it's something that'll work for you guys. Again, we're certified. My partner, Kevin, is Microsoft certified at least four or five times. I just recently got AWS certified. So you definitely have people on your side that kind of know what's going on so we can kind of walk you through some things. Again, just depending on where you're at in your journey, we just try to meet you where you're at. So with that, I will pass the torch back over to Nick. Well, there we go, folks. We got through it all. I just want to call out like what the differentiation between Kelly and Tony's team here. So like I said, the client services team that Kelly helps run is really there to help you manage your relationship with TechSoup. Tony and his team help you actually do better with the specific products that you've gotten from TechSoup and I think that at the end of the day, the great thing about TechSoup is that we do try to like fill several different roles depending on what kind of organization you're at and what your level of technology expertise and adoption really is. And like I said around the real people, like that's the other part of TechSoup is that you do have real people that you get to work with, that you interact with and when you need help, you can get help from a real person rather than just feeling like there's nobody to turn to and no way to get your question asked. And again, if your questions are gonna be really deep and technical around stuff, you really need to think about the booster quad membership specifically as a way to give your organization a little more access to what TechSoup can offer. With that, we've reached the end of today's webinar and I wanna say thank you to all of you who attended today, not just because you attended but also because you've all individually made a choice to work in the nonprofit sector and that says something about what your priorities are. You're trying to work to build a better community, to offer something to civil society to help make the world a better place and there are a million different ways you can do that but thank you to each of you who've made that choice in your career and where you're working right now. With that said, I know that you will receive emails after this webinar with a link to this deck. There are live links in this deck that you can click on to get to some of the offers and services we talked about but I encourage you to take a look at the TechSoup website, see if there's some things on there that might be helpful to you in your nonprofit and as you've already learned, we've got folks ready to help if that's what you need and with that, I will call this webinar done. Thank you so much for your time today.


All right. Hello, everyone. Let's quickly, so game plan for today, we will quickly blast through this lecture, and then we'll talk about the quiz, since that's probably all you care about. And we'll write some kernel code and we'll do some fun stuff just to make things like crystal clear. All right. So today, we'll talk about lock implementation. Last lecture, we tried the lock implementation and didn't quite work, right? We showed an example where two threads can call lock, and two threads can return from lock, and that is not a mutex, right? Two threads came, two threads went through, when in a mutex it should only be one at a time. So you can implement locks in software with minimal hardware support. The only two thing, two hardware requirements you actually need are atomic loads and stores, and you need instructions to execute in order, which sounds like a no-brainer, but processors today execute out of order, so that is not necessarily true nowadays, which makes your life of pain. So if these two things are true and you want to implement locks with no other hardware support, you can use something called Peterson's algorithm or Lampard's Bakery algorithm, which is essentially just you, if anyone's ever been to an old school like Bakery where you just pick a number and then you're served in that order, that's pretty much what it is. And we'll see what the other class talks about in terms of doing this if they don't show hardware support, but for now we'll talk about real hardware support that you would need to implement locks. So they don't skill well and you need special hardware support because now processors do execute out of order. Yeah, so within your processor, right, you have instructions and they get split into micro-instructions and the hardware to make optimizations will reorder them if it can and do weird stuff like that. Yeah, so it would reorder them such that you still get the same result, right? But internally it might, if we start caring about the details now in terms of data races and stuff, it might reorganize it where you'd still get the right result, but the details in between might be different and that might cause us some issues. But in terms of hardware support, there is this kind of magical atomic function so you can think of this function as atomic so it either fully completes or it doesn't complete and we'll call it compare and swap and give it a C API just to make it a bit clearer to read than assembly. So it's called compare and swap. It takes a pointer to an integer and then two integer values, an old value and a new value and it returns whatever value that pointer points to. And why this is a useful function is it will only swap if the original value was old and then it will change it to new. So that way if we have compare and swap and we give it L with a zero and a one, there's only gonna be two outcomes because this is atomic. Either compare and swap returns zero which means it pointed at a zero and you're guaranteed from using this function that means that zero got swapped with a one. So in only the case where compare and swap return zero then it will have changed that whatever it was pointed to from a zero to a one and that's the only way to transition from zero to one. Otherwise if it was already one, compare and swap will return one which would make this loop go on and on and on again. So it would just keep on doing the compare and swap. The value would be one. It would keep on looping, looping, looping until eventually the unlock happens and a zero is written to it and then another thread that was waiting at the lock could pass. So this is actually a valid implementation of a mutex. It is technically called a spin lock because as you can see this while loop just spins. It just tries over and over and over and over again and it doesn't do anything very smart. And it also violates another rule that we wanted for mutexes where things are fair because in this case if everything's just fighting over the lock you've no control over what thread actually gets the lock and it could be that the same thread just by virtue of context switching and whatever the kernel decides the schedule can be it can just be one thread that gets the lock over and over again when technically you should share it. So that was essentially a spin lock and compare and swap is actually a very common atomic hardware instruction.  So all that says it's called compare and exchange instead of compare and swap. Don't ask me why they cut so many letters so it saves them some typing I guess. But that's a valid implementation of a lock but it still has a busy weight problem and it's not the greatest implementation. Yeah, there's a C function for it but I think it's also called kum-stinge which is less readable, I just called it compare and swap. So it's a bit more readable. But yeah, so if you consider a uniprocessor system so something with only a single CPU core on it we know we're definitely wasting our time. Like if we can't get the lock here and I'm the only thread that's allowed to run if I see one, nothing else would have changed it to zero so I'm just kind of endlessly spinning for no good reason even though I should know better at that point that I cannot acquire the lock. So a better thing to do would just be to let the kernel schedule another process or another thread in the hopes that that frees the lock. So you are going to implement this in lab two, that's your yield. So instead if you see that you don't get the lock you could just simply yield and then hope another thread frees it up for you.  So this is what it looks like if you add a yield it doesn't complicate the code that much it's just if we see that we didn't successfully compare and swap which means the lock is still locked we just yield but now this has a we kind of eliminated the busy weight problem but now we have a what's called a thundering herd problem where if we had eight threads that came here and they all yielded well as soon as we unlock we know only one of those eight threads can acquire the lock after we unlock it but what's actually going to happen in this case is the kernel is going to wake up all eight threads at some point and then they're all going to try to get the lock even though we know seven of them aren't going to succeed and only one is. And we still have the problem where we have no control over what thread gets the lock next. So ideally we want to be able to reason about it and the easiest thing to do is to just kind of have like a first in first out queue so you're just in order of when you try and acquire the lock is the order you actually get the lock. So we can change the implementation and we can add a weight queue so now when we do the compare and swap and we see that the lock is acquired by another thread we can go ahead and add this thread this current thread to a lock weight queue and then we can put ourselves to sleep which means we need another thread to wake us up. So in the unlock we would unlock the lock and then check if there's any threads in the weight queue cause we need a thread to wake up if there's a thread waiting if there's a thread in the weight queue we would wake up one thread and it would be the thread that's at the front of the list so hopefully we're nice and fair but because we're now in the land of concurrency and difficult programming there's actually two issues with this code even though it looks kind of correct one's called a lost wake up and the other one is just called the wrong thread gets the lock. So let's have a look at it and see if anyone can tell me where my problems are. So looking at this code first thing we'll try and identify is a lost wake up and the lost wake up should mean that a thread gets put to sleep and it never gets woken up and if you wanna go the real life analogy the thread essentially gets put in a coma which is that. So the comment above that puts itself into the queue. So what thread one is like here it adds itself to the queue but hasn't slept yet. So thread two comes here it goes here to here so it unlocks. Yeah, so that's one problem so it would come in here and then there's a thread in the weight queue that's not asleep yet and then it would try and wake up although that's something you would check you probably get, if you wanted to you could check some error code from the wake up and be like oh the thread's not asleep yet or something but that's definitely a problem that we don't consider now so that's one problem. What about the opposite where I am asleep and I never get woken up again? Yeah, yeah well that wouldn't happen though if here let's see if we had another condition here that's like if not asleep try again. So then that would fix that. Yep, so you mean like if thread one, whoops, what the hell did I just do? So if thread one instead of being context switch there it got context switch there. Yeah, so and this also assumes that thread two has a lock and it's calling unlock so we would assume thread two already has a lock and then thread one comes into the lock function it would try the while loop, compare and swap would return one so that means the lock's already acquired and we just said thread two has it. So it would go into the while loop and it might get context switched out immediately before it adds it to the queue and then thread two could go ahead and unlock itself so it would set the lock to zero and then check if there's any threads in the queue there currently is not a thread in the queue so it wouldn't bother waking up any thread and it would just return and then we would get context switch back to thread one and then thread one would add itself to the queue and be put to sleep and now no one is going to wake it up because no one is going to call unlock, right? You need to pair lock with unlock. It could be woken up if someone calls lock and unlock but that would also might add another thread to the queue in which case you wouldn't clear the queue so you're missing a wake up. Yeah, yeah, yeah, yeah, yeah, yeah, so it's all done. So does that make sense? All right, how would we fix this? Oh wait, no we still have another problem to go over so that's lost wake up. Can anyone think of a case where we have multiple, say we have three threads, here I'll make it a bit easier, say we have three threads, that can still be there, three threads, T one has the lock and then T two is in wait queue. So if that is our beginning assumption, can anyone tell me a case where some rogue thread could come in that is not in line and essentially bypass the line? Yeah, so right now if T two is in the wait queue, the next thread that should get the lock is T two. So assume we have another thread called T three. So is there any way for thread three to get the lock before thread two? Yeah, so thread one has the lock already so it would be the one responsible for calling unlock. So at this point it would be say thread one is here, it's about to, it's called unlock and then it goes ahead and changes that value from a zero to a one and then it gets context switched out right before the if statement and if right before the if statement thread three comes in which is the new thread and calls lock it would see that the value of the lock is a zero. The compare and swap would return zero which means it just grabbed the lock and it just swooped right in and took it when it should have been thread twos turn, right? It essentially got like the fast pass at Disneyland without paying for it which Mickey Mouse does not like that. So does that make sense that they can still bypass the queue? All right, cool. So let's fix that. So here's example just so you have it of the lost wake up which is slightly different than what we just kind of discussed and then the wrong thread getting the lock just so you have it. So here's how you would fix that problem. It's kind of big. It's ugly and we will go through it quickly. I'll get myself out of the way. Okay, so to do this we are going to use essentially two locks. So there is lock which is what we want to represent the entire mutex and then we're going to have a second lock called guard that we only use internally and guard we will use our spin lock implementation because we know it works and this is the only place we'll use that guard lock so we know the code is nice and short. So having a spin lock won't be that big of a detriment. Yeah, so lost wake up is only going to happen if that queue is empty and it essentially skips that if statement when it knows if another thread is about to be added. But yeah, you could not have a bug if there was something already there that was ahead of it. So there's a thread waiting anyways and that thread would get waking up even if I haven't added myself to the queue yet. So likely you wouldn't see this bug ever, right? It's kind of a rare one. It would only happen if the list is empty. Okay, so let's break down this quick because it kind of looks ugly. So whenever you see this compare and swap with the guard you can replace that with just think it's a spin lock. So just replace that with a lock to guard and then here is an unlocked to guard and unlocked to guard. So we're locking into the beginning of the function and then there's two paths and we unlock it in both paths. So we grab the guard lock so everything until we unlock it is all you know only one thread can be there at a time so we won't have any data races which is what we didn't want which is what happened before we got context switching and bad things happened. So in the case the lock isn't acquired we don't need compare and swap anymore because now we have this guard and we're under mutual exclusion so we're the only thread so we don't need compare and swap anymore to actually acquire the lock. So we check if the lock is zero if it's zero we just change it to one because we're the only thread actually accessing it and then that means we would acquire the mutex and then we can unlock it and then it would return. So that's the case where we don't have to do anything we just immediately get the lock and it's all good. The other case where it is locked we would add ourselves to the queue throw ourselves at the back of the list and then unlock the guard and then put ourselves to sleep. And then in the unlock here is our essentially our lock to guard and then we can check the queue because now if it was going to add itself to the queue it would have already done that because it had the guard lock so it wouldn't be able to go jump from here to there because it would need a lock to actually execute this it's in a critical section. So after the guard we check if the queue is empty and then if it's empty we can just release the lock we don't have to do anything. Otherwise instead of even unlocking it we can just keep it locked and just transfer it to the next thread because the wake up is going to transfer the lock here we're just going to wake up a single thread so it'll transfer here the value of that lock will still be one indicating it's locked and it'll just continue and will be all good. So does that make sense to everyone? Yep. Yeah so the guard is like a mutex right it is a mutex but it's a spin lock so it behaves the exact same way. So like this is locked this is unlocked this is unlocked so anything between the lock and unlock only one thread can be there at a time so we don't have any concurrency issues. Yeah so that there is a slight error or well there's a slight bug here because we unlock here and it could be the case where before we put ourselves to sleep another it could context switch right at this point and this can actually run now because it can acquire the guard and then it would do a wake up on a thread that's not asleep yet but that's actually a condition that you can check so your wake up can be like oh that thread's not asleep yet. Yeah so in this case there's a slight data race but you can actually detect it so if wake up fails I know something is in the queue and it's about to put itself to sleep and I got super, super unlucky so if I just it's like the spin lock right if I just retry a few times probably be fine but yeah there's a slight yeah there's still a slight data race but that's like even catching that I didn't see it the first time. All right that makes sense to everyone? Yep sorry so the guard is exactly a view text like what we saw yesterday so only one thread's allowed there at a single time because this is essentially lock and then unlock so if you have the thread and you are executing this line here say you're executing this line here and you get context switched out you acquired the guard right so no one else is in this code at all they would just be essentially either here or there and trying to acquire the lock and they couldn't get it so it's just gonna wait till you get context switched back to the original thread and then it's gonna continue executing yeah yeah so it's a mutex so like this is a valid implementation of a mutex right and it only allows one thread between lock and unlock and we're essentially just using this spin lock in this code so we're using a spin lock as a guard to implement a smarter lock that will actually put the thread to sleep and do all that good stuff so we eliminated that busy wait problem right we're just trying to solve all these problems the last wake up the wrong thread getting the lock and also the busy wake up and we were trying to also be fair so now we have a queue that works you can't bypass the queue you can't have a lost wake up you have to retry you might have like it might be about to go to sleep but you can retry that and we put ourselves to sleep right okay so that's the actual implementation of a mutex that you'll see I don't think you actually have to implement it but that's essentially what a mutex is which is kind of cool so also the next thing I'll say is remember what causes a data race so a data race is when there's two concurrent accesses to the same memory address and at least one of them is a right and the right is kind of the important part there so if the only the source of the data race is the right that means we could have as many readers as you want you don't even need a mutex as long as nothing writes at the same time so if you just and it depends on your program so you might have a program that writes very very infrequently and then has a lot of readers so ideally you'd like to be as parallel as possible so if you can have as many readers as you want you want to permit that right if I use a mutex if I just have a mutex in my arsenal I would have to put a mutex around the read and the writes just so I don't have any concurrent accesses that could be a right so what you can do is implement a lock that has different behaviors based off whether you're acquiring it for reading or writing so there is something called a read write lock so with mutexes or spin locks you just have to essentially just lock the data even if you don't know if a right could happen which is what I just talked about briefly but you want reads to happen in parallel as long as there's no writes so there's for a read write thread you separate out the lock so there's going to be a lock specific for reading and a lock specific for writing and the property you want is that multiple threads can hold a read lock but only one thread at a time can hold a write lock so that you don't have any data races right you'd eliminate that two concurrent access problem and make it back down to one and the read write lock would essentially wait for all the readers to be done until you can get exclusive access to that lock so we would use the same idea of having a guard lock here and essentially our guard lock and this time I'm just using it as a lock just to assume it's like a mutex I'm using the guard to essentially guard this integer reader value so I don't have any concurrent accesses so this looks exactly like we're going to use it to keep track of the number of readers that are currently active and this plus plus reader sure looks like a lot like plus plus count and we don't want the same issues where we don't know the correct numbers especially if we're actually managing a lock because we also have a decrement so in the case of the right version of the lock we want it to essentially exactly be our original mutex so write lock just calls lock and write unlock calls unlock for our lock in that structure and then the only difference comes for the read lock so it would acquire the guard and then unlock the guard so all of this code and all of this code they're in critical sections that are protected by the same guard lock so they can't run concurrently because we're changing n readers so all it does is keep track of the number of readers so it just increments the count that you would assume is initially zero and then if it went from zero readers to one reader so this is the first reader it would just try to acquire our lock and then after it's done it would unlock and so now if another thread comes in and calls read lock again it would just increment itself from one to two it wouldn't have to call lock again because we're just reusing that lock it's still a mutex if we called lock on an already locked lock it's too many locks and it dies so then our unlock we would just decrement the number of readers and then if we see that we're the last reader we just do our normal unlock call yep everyone good yep so you need the read lock because it acquires that lock if you didn't have a read lock all the reads could still happen and a write could happen as well and that's still a data race yeah yeah so this is if there's one reader it gets the lock and then they can all share it essentially so either there's like two versions of the lock either just the writer just has it like a mutex and it's the only one with it or one or more readers have the lock and they're all sharing the same lock okay this makes sense cool all right let's wrap up and talk about quiz stuff and have more fun so you want critical sections that we talked about today and yesterday to protect against data races you should know what they are very very important and even more important how to prevent them there are lots of fun bugs and lots of fun and interesting questions you can ask about them because preventing them is very hard so mutexes and spin locks are the most straightforward that we actually know how to implement now ideally you need some hardware support to implement locks and you need some kernel support for the wake up notifications or you actually have those you're actually writing those yourselves in lab two and then you know if you have a lot of readers you have a read write lock all right cool let's talk about the quiz so did anyone go on corkis so everyone saw the micro quiz is everyone anyone worried about it yeah yeah what okay so let's quickly go over the micro quiz because this will take us like two seconds so question one again this wouldn't be valid because that's the word MMU on it I don't know why I read this one but so on a context much between two processes the operating system has to modify the state in the MMU to make this valid for you guys it would be the operating system has to swap out address spaces so is this true or false true beauty question two whoops which is probably on the harder end of things for this so when a divide by zero in a program occurs a trap instruction is invoked so the kernel can and kill the program false why yeah trap instructions the system called what's this actually called an exception which will generate a signal so close so that false on a computer system with just one process there are no benefits to having multiple threads with one process that better be false otherwise you're all taking this course for no reason alright which of the following so this might not actually be super valid but it's like kind of general enough but this is probably like the hardest question on this in terms of like knowing stuff from the lecture which of the following is responsible for translating a process's virtual memory address to physical memory address whoa alright the compiler probably not operating system kernel not technically which is why this question is kind of odd hardware technically yes because the MMU is hardware and does yeah MMU is on the CPU which well this is why the question is kind of weird because it's like kind of classifies hardware so technically your kernel will set up essentially lookup tables for the MMU which is why I don't want to talk about it yet because knowing that it translates it doesn't really help anyone so technically this answer is hardware it's like one of the most silly questions on this which is why this little micro quiz is probably actually harder than the actual quiz you don't know that yet we haven't talked about that so question 5 assume you have a computation such as matrix multiply that you would like to paralyze so the computation can be completed more quickly you can do this by either using multiple threads within a process or by using multiple processes to decide which of these two approaches you use you consider various tradeoffs which of the following considerations are valid select all that applies so this is your multiple answer question so using multi processes will result in less physical memory needed no at best it would be a wash or negligible but it's not lower alright using multiple processes will result in slower more costly synchronization yes because if you have separate processes right the only way they can talk to each other is through the kernel which would have to be system calls which is slower using multiple processes will result in faster data sharing false because I just said the first thing alright using multiple processes will result in higher context switching overhead true right because it we don't know everything involved in context switching processes but it's at least going to be the same thing as threads plus swapping the address space so that's more that's slower alright using multiple processes will result in harder to detect bugs we got true true yeah so that's actually kind of true because remember if a thread dies and does like a segfault or something whole process is going to die you're not going to have any single clue as to where that came from while if one of your processes dies it won't kill the other one and you'll at least have an idea about where it came from so yeah so another explanation is like well if you have processes to link it back to the first one to talk to each other goes through the kernel so you can monitor that pretty easy well if you share the same address space it's a lot harder to see if you're walking over other things yep so it's essentially just the opposite so synchronization would be much faster but it'd be harder to debug and it'd be faster context switching it's just the opposite of this yeah synchronization so any communication between the two processes or like synchronization generally is involved with locks and stuff like that and like making sure you do things in the right order which we don't really know how to do yet we kind of know how to prevent data races but like locks and stuff aren't even on the quiz yeah yeah so any communication has to be super explicit because it has to go through the kernel yeah context switching overhead is just the amount of time it takes to context switch yeah switch process these are threads so it's going to be much faster to switch between threads than it is for processes because processes would have to change the address space as well yeah it takes more time to switch between two processes than it does to switch between two threads within a process yeah yeah well if you have processes in this case one process is just going to have one thread right if everything's a separate process it depends if it's a kernel thread or a user thread if it's a kernel thread the kernel just decides if it's a user thread you get to decide alright let's submit our quiz and see how we did sick we yeah what do you mean we got it right you think I'm just going to go through and have them all wrong yeah <IP_ADDRESS>.1.1. beauty hundo more details about the quiz just because I guess people like hearing about it open book you can use any of your notes, lecture slides, textbooks you apparently are not allowed to search the internet you're not allowed to communicate with each other in any form or fashion or whatever there's a room booked if you're worried about the internet and want a witness it will be GB 304 you're not required to be there but benefit is I will be there I can answer questions but it would be like a normal exam where I hand up and I go over to you I think Ashwin will also be on zoom if you're not in that room and then also benefit is if the internet in that room goes down you have a valid witness so if the internet goes down and everyone in that class can't do the quiz you at least have a witness so that might be good or it might be somewhat fun probably not quiz format it will be 15 true false 5 multiple choice and 5 multiple answer with 2 short answer questions that are between between like max 3 sentences if you write more than 3 sentences you probably are like BSing and probably shouldn't do that yeah PS that's like a pet peeve of mine when I was the TA in marking if you like just spew knowledge that you think is right but not relevant to the question that's a real crap shoot if your TA just doesn't like that or will show pity on you I didn't show pity for that well if you just dump knowledge for part marks that's not even relevant you're just like wasting my time in your time yeah when you make a process it just has a single thread in it yeah yeah depends what your threads do if you have if they're kernel threads and you have multiple CPUs they can be run in parallel yeah alright cool alright to make things crystal clear let's write some kernel code wait it's actually not that hard alright not sys calls I don't have to communicate with the kernel we are now the kernel so kernel code is not super different aside from a few things that are much different that makes sense but the kernel code is just C code in C code there's nothing special with it so it has include files so you include stuff from kernel and there's a few macros so you'll notice in this code there's no such thing as a main function this is my entire function so there's not going to be a main because this isn't going to be an executable because this isn't going to be a process because this isn't going to run in user space this is the kernel yeah so processes are just user space things so I am the kernel now that's it so there's not going to be a main because executable because the kernel's already running at this point, right? I'm typing into my system, kernel's already here. So the way kernel code works, at least for like fairly modular things that you can throw into the kernel is you make something called a module and you can add code that executes whenever you load it and whenever you unload it. So this says whenever I'm loaded into the kernel, you should run a function called hello init and whenever you're unloaded from the kernel, you should run a function called hello exit. So hello init, you'll see a few differences with C. So like normal C you've been written, this is not print F, this is print K. Anyone hazard a guess as to why? Yeah, do I have the C standard library in the kernel? No, because I am the kernel. So in the kernel, it's a bit different too. So it's essentially like an internal buffer just for logging purposes. So everyone's probably used logs before in some respect or at least seen them. So there's different levels of messages you can run depending on how severe it is. So like you could have error messages, warning messages, debug messages, and so on. So I just said, hey, I'll put an info message just because it's nice to read and I'll just print to the internal kernel buffer hello init and that's it. And then when I exit, I'm going to print hello exit. So if we go ahead and compile this, it's like it kind of is a C file, but it uses a bunch of kernel headers. And when you compile it, you'll see that it generates some kind of normal looking stuff. There's like a .c file, this .mod stuff that is supercurl specific. But generally you see if you compile it in little chunks, there's going to be like a .o file, right? We've seen .o files, but because it's a kernel, this is a .co file. So which just stands for kernel object. So it's just indicating that you shouldn't probably use this unless you're using it with the kernel. So that's all you get. So you get this kernel module and it is a normal ELF file and the kernel knows what to do with it. So you might ask yourself, well, I have some code. It's clearly not running because it's not executing it all. How do I even see it? So to insert it into a kernel, you use this command. So I have to use it as a super user and it will. Inst.mod is to short for install module or insert module, however you want to think of it. So I'm going to insert hello.co into the kernel. And then as soon as I insert it into the kernel, it will start running that hello init and that's now going to be running in kernel mode. So I can do whatever I want. So if I insert that, oops, it says file exists because I tried it out before. OK, we're going to see a bunch of messages. But if I insert it into the kernel, it now runs and now I can see my debug messages if I use this command called dmessage. So that lets you read and you'll never be tested on this. We're just exploring kernel mode. So you can use dmessage to see all the internal kernel messages and then dash L to see all the things that are at the info level. So if I do that, I called it a few times. And this is the latest one. So I can see that within at this time, so everything's time stamped in the kernel, I loaded my hello init kernel module. All right. And then I could go ahead and remove the module from the kernel and then run dmessage again. I see hello exit. So now my code is no longer running in the kernel. Yeah. Yeah. So this was this morning's lecture. This was at the end of the lecture because I, I'll, I'll S trace it for you to see what happens. And this was me just fixing it. And then this is right now. Yeah. Yeah. So how does it know how to run it? So the kernel does a lot of like hacky things to make it work. But essentially, if you include that Linux dot module and compile it with all the header files, the Linux kernel understands. It defines these things called module init and module exit, which register functions to run whenever it's loaded into the kernel. So we can see that if anything executed because we insert into the kernel, it has to be executing in kernel mode.  So if I knew that function, right functions to call, we could probably finally kill and knit if we really wanted to, because we are now the kernel and we can do whatever we want. Right. And we can see even if we want, we can, uh, we can S trace. Oops, pseudo S trace. We can see what ints mod actually does because it shouldn't be too much of a mystery. If it's inserting itself into a kernel, the only way it can do that is if it makes a system call and says, Hey, Colonel, please insert this into yourself and start executing. So if we S trace it, we can actually see what's going on because we now know how to read it. So at some point it opens that hello dot KO file, gives it file descriptor three, and we can see here that it is definitely an elf file because we know what they begin with now, and then it does some other garbage where it f stats it and then the important call is right here. F init module gives it file descriptor three, which is our kernel module, and then after that system call completes, the kernel is free to run that module as it sees fit. Yep.  It's they're compiled. Yeah. So, so it's the, just a dot KO is kind of like a little piece of a library, right? I just defined hello init, hello exit. That's it. And I said, please run. What I'm only able to insert it into the kernel because it does some user checks to make sure you can actually protect that system call. All right, cool. We wrote some kernel code. So right now, if I wrote anything here, I can do whatever I want.  I can loop over all of my processes and just kill everything. You'd have to reboot.   So you're going to, if you power it back on again, just reboots, right? No, no, because I just inserted it. Yeah. You have to insert the module. Yeah.